Migrate: Create new SQL Database missing first char on name

Created on 8 Jan 2020  路  10Comments  路  Source: prisma/migrate

Version: Preview19
Platform: Windows 10

Running primsma2 lift save when the DB doesn't exist prompts to create the DB but the db name doesn't include the first char (only in the message), it creates the DB with the correct name. See this image for reference:
image

Also, when you press YES, it hangs. I need to CTRL + C then run it again for it to work.

bu2-confirmed kinbug tectypescript cli

Most helpful comment

I don't think so.

It creates the database, it just hangs until you CTRL + C. Then the naming is missing a char. I don't think it's the same.

All 10 comments

Can you please tell me the exact steps to reproduce this? I mean if you bootstrapped this using the cli can you please list out the exact flow or please share your schema if this was an existing project.

Schema:

datasource db {
  provider = "sqlite"
  url = env("SQLITE_URL")
  enabled = env("SQLITE_URL")
}

generator photon {
  provider = "photonjs"
}

model User {
  id String @default(cuid()) @id
  createdDate Int
  updatedDate Int?
  username String @unique
  emailAddress String @unique
  password String
  role Int
  canActAs User[] @relation(name: "canActAs")
  hasActingAs User[] @relation(name: "canActAs")
}

I have a script command: "lift:save:dev": "SET ENVIRONMENT=dev&& SET SQLITE_URL=file:dev.db&& SET SQLITE_ENABLED=true&& prisma2 lift save" in package.json.

I just ran yarn lift:save:devand it's an existing project.

I don't think so.

It creates the database, it just hangs until you CTRL + C. Then the naming is missing a char. I don't think it's the same.

Can confirm this behavior, on MacOS, also using SQLite.

I tried this again and I can confirm this now with the following schema:

datasource db {
  provider = "sqlite" // other options are: "mysql" and "sqlite"
  url      = "file:dev.db"
}

generator client {
  provider = "prisma-client-js"
}

model Post {
  id          String   @id @default(cuid())
  title       String   @default("")
  tags        Tag[]
}

model Tag {
  id        String    @id @default(cuid())
  name      String    @default("") @unique
  posts     Post[]
}

I just ran prisma2 migrate save --experimental and indeed the first character from the database name was missing:
image

Internal note: dropping from current sprint

New prompt (without ink)

Screen Shot 2020-07-06 at 16 31 40

Yeah noticed it yesterday when I was using dev version, pretty cool!

Was this page helpful?
0 / 5 - 0 ratings