prisma / migrate

Issues for Prisma Migrate are now tracked at prisma/prisma. This repo was used to track issues for Prisma Migrate Experimental and is now deprecated.
https://www.prisma.io/docs/concepts/components/prisma-migrate
Apache License 2.0
766 stars 22 forks source link

Lift save/up hangs at creating SQLite db #219

Closed marcjulian closed 4 years ago

marcjulian commented 4 years ago

The command prisma2 lift save and prisma2 lift up hangs at Creating database .....

Screenshot 2019-11-24 at 13 47 29

This behavior exists in the following versions I tested: prisma2@2.0.0-preview016.2, binary version: b72fd0a786adc77ba6c61d0a9637ff0371e433b0 prisma2@2.0.0-alpha.351, binary version: b8d90fea39d266b128b4d748db5aca8505bb1026

It still works with the version prisma2@2.0.0-preview016, binary version: 377e2db71bae5da19d0090558c8819ff57dfdfc6

Env Mac 10.14.6

pantharshit00 commented 4 years ago

I am unable to reproduce this. Can you please share your datamodel with us?

marcjulian commented 4 years ago

Of course, it appears in this project https://github.com/fivethree-team/nestjs-prisma-starter/tree/prisma2

datasource db {
  provider = "sqlite"
  url      = "file:../db/dev.db"
}

generator photon {
  provider = "photonjs"
}

model User {
  id        String   @default(cuid()) @id @unique
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  email     String   @unique
  password  String
  firstname String?
  lastname  String?
  posts     Post[]
  role      Role
}

model Post {
  id        String   @default(cuid()) @id @unique
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  published Boolean
  title     String
  content   String?
  author    User?
}

enum Role {
  ADMIN
  USER
}
pantharshit00 commented 4 years ago

I can confirm this bug.

I think it is related to https://github.com/prisma/prisma2/issues/936#issuecomment-558578657 so for the time being don't use a relative path.

marcjulian commented 4 years ago

Thanks for looking into the issue

timsuchanek commented 4 years ago

Thanks a lot for reporting 🙏 This issue is fixed in the latest alpha version of prisma2. You can try it out with npm i -g prisma2@alpha.

In case it’s not fixed for you - please let us know and we’ll reopen this issue!

marcjulian commented 4 years ago

I tested it with prisma2 version 2.0.0-alpha.453 and hangs at creating the db at path file:../db/dev.db

pantharshit00 commented 4 years ago

I can confirm this is still an issue.

image

(Note: only happens now when folder db doesn't exists)

timsuchanek commented 4 years ago

This is a problem in the create database RPC of the migration engine.

tomhoule commented 4 years ago

This is fixed by https://github.com/prisma/prisma-engine/pull/379 - it should be in the next alpha release :)