Sang Kim
12/28/2020, 5:48 AMnpx prisma migrate save --experimental
Hyo
01/07/2021, 11:57 AMprisma migrate dev
and prisma migrate deploy
to update our remote database and this should be done before merging the PR
since the queries won’t work without it. The sourcecode will be deployed to production when merged to master. The problem is, when we run prisma migrate dev
the prompt appears (Type in migration name) and we need to type in something to apply it. Should we run it before pushing the commits to branch
that would be merged to master
?
Currently, in our opensource project (https://github.com/dooboolab/hackatalk), we are doing prisma migrate dev
and prisma migrate deploy
locally when we updates schema.ts
but I am wondering if this could be done over the air.Hyo
01/11/2021, 2:22 AMprimsa migrate dev
failed?
Error: The migration 20210111021729_item_style_none failed when applied to the shadow database.
Fix the migration script and run yarn prisma migrate dev --preview-feature again.
P3006
Migration `20210111021729_item_style_none` failed to apply cleanly to a temporary database.
Error:
Database error: Error accessing result set, column not found: itemStyle
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:174
1: sql_migration_connector::sql_database_migration_inferrer::validate_migrations
at migration-engine/connectors/sql-migration-connector/src/sql_database_migration_inferrer.rs:89
2: migration_core::api::DiagnoseMigrationHistory
at migration-engine/core/src/api.rs:148
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
Daniell
01/16/2021, 8:45 PMRUN npx --no-install prisma migrate deploy --preview-feature
for my Docker command 😅Daniell
01/16/2021, 8:45 PMJohn Peña
01/19/2021, 4:10 PMprisma migrate up --experimental
(this is in version 2.12): ‘Error: Error in command input: Could not load migration from database.’Barak Cohen
01/21/2021, 4:01 PMprisma db seed
when prisma is in a custom folder? we're using nx to manage our monorepo and i can't find a flag to customize the pathAleksandra Jovanović
01/25/2021, 2:27 PMutf8
and I saw this issue where that behaviour was changed: https://github.com/prisma/prisma-engines/pull/889
Is there a way to specify it or do I have to first create the migration, modify it and then run it?
Thanks 😊Aleksandra Jovanović
01/26/2021, 11:01 AMprisma migrate dev --preview-feature
(even when there’s no changes). In the .sql files there are a bunch of ALTER TABLE statements modifying every TINYINT to the same thing that they already are in the database. And it’s being generated every time, looks completely the same. This is an example:
ALTER TABLE `category` MODIFY `active` TINYINT NOT NULL DEFAULT true;
I was looking out for issues, and found this: https://github.com/prisma/prisma-engines/issues/1257. I’m not sure if that’s the same issue, if not I can open a new one 🙂 Thanks!Pascal Sthamer
01/28/2021, 9:20 AMprisma migrate dev --preview-feature
with prisma 2.14.0, I get the following error:
Error: A migration failed when applied to the shadow database:
P3006
Migration `20210128090300_init` failed to apply cleanly to a temporary database.
ERROR 42000 (1142): ALTER command denied to user
I think the problem is that the database user does not have the required access to the shadow database.
Only granting CREATE, DROP ON *.*
like stated in the docs, seems to be not sufficient.William Minshew
01/29/2021, 10:43 PMWilliam Minshew
01/29/2021, 10:43 PMWilliam Minshew
01/30/2021, 1:51 AMWilliam Minshew
01/30/2021, 1:51 AMDaniell
01/31/2021, 2:42 PMÖmer Özdemir
02/01/2021, 8:07 AMDaniell
02/01/2021, 1:05 PMdefrex
02/01/2021, 5:26 PMprisma/migrations/migration_lock.toml
intended to be commit to git, or does it just represent local state?Zarazas
02/02/2021, 12:23 AMprisma migrate reset --preview-feature -f
command to run tests against my preview environment created by vercel. However I get
Error: Database error: Error querying the database: db error: ERROR: must be owner of schema public
On DigitalOcean the public
schema is created by the role postgres
which is AFAIK not accessible. Is there any solution to this problem?Zarazas
02/02/2021, 2:00 AMDaniell
02/02/2021, 10:23 AMAlberto Perdomo
Alberto Perdomo
nativeTypes
preview feature.
Using the native type syntax for PSL, Prisma Migrate will generate the corresponding DDL statements in the migrations.
We also added support for seeding. You can find the guide here and the reference docs here. Feedback for the seeding functionality can be shared here.
Prisma Migrate will automatically trigger seeding when the database is reset.
More info in the release notes for 2.15.0.Alberto Perdomo
Unsupported(String)
and dbgenerated(String)
, which makes it possible to use Prisma Migrate to manage columns of types that are not yet supported by Prisma.
Example:
generator client {
provider = "prisma-client-js"
previewFeatures = ["nativeTypes"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
bio Unsupported("multilinestring") @unique @default(dbgenerated("''"))
}
Prisma Migrate generates the following migration:
CREATE TABLE `User` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`email` VARCHAR(191) NOT NULL,
`name` VARCHAR(191),
`multilinestringField` multilinestring NOT NULL DEFAULT '',
UNIQUE INDEX `User.email_unique`(`email`),
UNIQUE INDEX `User.bio_unique`(`bio`),
PRIMARY KEY (`id`)
);
dbgenerated(String)
can also be used with supported native types. Here is an example of how to leverage this to use database-generated UUIDs as default for a UUID column:
model User {
id String @id @db.Uuid @default(dbgenerated("gen_random_uuid()"))
name String?
}
Prisma Migrate generates the following migration:
CREATE TABLE "User" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"name" TEXT,
PRIMARY KEY ("id")
);
There is a new option --skip-seeding
for prisma migrate reset
and prisma migrate dev
.
More info in the release notes for 2.16.0.Alberto Perdomo
Bart W
02/07/2021, 12:04 AMchrisdhanaraj
02/11/2021, 4:58 AMpg_dump / pg_restore
to get a set of data to work with (also, I like developing with a clone of real data).
However, when running prisma migrate
it's always going to reset my db from scratch - is there a good workflow to
• Seed my local database with production data
• Update my database with some new model (i.e., add a column), without blowing it all up?tom
02/16/2021, 3:10 PMBilly Ohgren
02/16/2021, 6:16 PMMike Cavaliere
02/17/2021, 2:12 PMuuid String @default(uuid())
Postgres error:
Error: Database error: Null constraint failed: (uuid)