I did the Prisma2 tutorial, created the first model User, let me generate migration files via prisma2 lift save --name 'init' and ran prisma2 lift up. It worked but didn't check if the database then actually changed. (Am using Postgres via a Docker Compose.)
I then completely stopped the Postgres server and removed its associated volume that was created via my Docker Compose file:
version: "3"
services:
postgres:
image: postgres:11-alpine
restart: always
ports:
- "5433:5432"
volumes:
- postgres:/var/lib/postgresql
environment:
POSTGRES_PASSWORD: "prisma"
POSTGRES_USER: "prisma"
POSTGRES_DB: "prisma"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
volumes:
postgres:
So the data was completely gone. I then re-upped the Docker services and ran prisma2 lift up to migrate my Postgres database to the last state.
The output was All migrations are already applied but there are no tables, since I've completely renewed the Postgres server.
Is this intentionally?
Can you please check whether there is a _Migrations table?
I am unable to reproduce this. Please double-check via the UI.
@pantharshit00 may have looked into the wrong schema. It's working. The default schema was default@default, or something like that. Forcibly set it to prisma with an environment variable. Filled with data :)
@pantharshit00 this issue still persists with the SQLite DB. The database contains only the _Migrations table. The other tables are not being created.
prisma2 version: 2.0.0-preview018.1
OS: Linux
I have the same issue with a postgreSQL database of only having the _migrations table after trying to migrate
Edit: I think it got fixed with Preview 018.2
I can confirm this should be fixed in preview018.2
Most helpful comment
@pantharshit00 this issue still persists with the SQLite DB. The database contains only the
_Migrationstable. The other tables are not being created.prisma2 version:
2.0.0-preview018.1OS: Linux