Iradukunda Irenee
12/07/2021, 3:56 PMnpx prisma db push
but i'm getting this error .any help?Iradukunda Irenee
12/07/2021, 8:42 PMError:
Invalid prisma.post.findMany()
invocation:
Can't reach database server at `ec2-3-229-127-203.compute-1.amazonaws.com`:`5432`
Please make sure your database server is running at `ec2-3-229-127-203.compute-1.amazonaws.com`:`5432`.Iradukunda Irenee
12/07/2021, 8:42 PMIradukunda Irenee
12/08/2021, 11:33 AMAthir Nuaimi
12/11/2021, 6:00 PMGarrett Tolbert
12/15/2021, 2:37 PM127.0.0.1:3309
is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline". I'm really not sure how to fix it so my database has my schema changes. I hope this gives better insight into the challenges I'm having.Chris Bitoy
12/20/2021, 3:05 PM//Error:
// 71 const template = await prisma.template.create({
// data: {
// objective: {
// create: undefined
// },
// creative: {
// create: {
// + brandName: String,
// + brandLogo: String,
// + headerImage: String,
// ? creative_format?: String,
// + projectName: String,
// + creativeUrl: String,
// + thumbnailUrl: String,
// ? minimum_secs?: Int,
// ? owner_id?: String,
// ? campaign_id?: String,
// ? parent_c_id?: String,
// ? createdAt?: DateTime,
// ? updatedAt?: DateTime,
// ? Campaign?: {
// ? create?: CampaignCreateWithoutCreativeInput | CampaignUncheckedCreateWithoutCreativeInput,
// ? connectOrCreate?: CampaignCreateOrConnectWithoutCreativeInput,
// ? connect?: CampaignWhereUniqueInput
// ? }
// }
// }
// },
// include: {
// objective: true,
// creative: true
// }
// })
// Argument brandLogo for data.creative.create.brandLogo is missing.
// Argument brandName for data.creative.create.brandName is missing.
// Argument projectName for data.creative.create.projectName is missing.
// Argument headerImage for data.creative.create.headerImage is missing.
// Argument creativeUrl for data.creative.create.creativeUrl is missing.
// Argument thumbnailUrl for data.creative.create.thumbnailUrl is missing.
// Note: Lines with + are required, lines with ? are optional.
I don’t want to flood this channel with copy/paste All the codes, but please find the schema model, routes, and test data
here on Codesandbox: https://codesandbox.io/s/crimson-pine-ipdd5?file=/src/schema.prismaMuhad B K
12/21/2021, 6:16 AMChris Bitoy
12/22/2021, 4:23 PMnpx prisma db pull --force
- do I run a risk of dropping all tables in my db? What I am trying to do is pull all the tables from my production db to my local machineMischa
12/28/2021, 7:06 AMMischa
12/28/2021, 7:06 AMMischa
12/28/2021, 7:06 AMChris Bitoy
12/30/2021, 4:17 AMHyo
01/10/2022, 5:41 AMDMMF
type in Rust or should I rewrite this again in Rust side?
export declare namespace DMMF {
interface Document {
datamodel: Datamodel;
schema: Schema;
mappings: Mappings;
}
interface Mappings {
modelOperations: ModelMapping[];
otherOperations: {
read: string[];
write: string[];
};
}
interface OtherOperationMappings {
read: string[];
write: string[];
}
interface DatamodelEnum {
name: string;
values: EnumValue[];
dbName?: string | null;
documentation?: string;
}
interface SchemaEnum {
name: string;
values: string[];
}
interface EnumValue {
name: string;
dbName: string | null;
}
interface Datamodel {
models: Model[];
enums: DatamodelEnum[];
}
interface uniqueIndex {
name: string;
fields: string[];
}
interface PrimaryKey {
name: string | null;
fields: string[];
}
interface Model {
name: string;
dbName: string | null;
fields: Field[];
fieldMap?: Record<string, Field>;
uniqueFields: string[][];
uniqueIndexes: uniqueIndex[];
documentation?: string;
primaryKey: PrimaryKey | null;
[key: string]: any;
}
type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
type FieldNamespace = 'model' | 'prisma';
type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes';
interface Field {
kind: FieldKind;
name: string;
isRequired: boolean;
isList: boolean;
isUnique: boolean;
isId: boolean;
type: string | DMMF.SchemaEnum | DMMF.OutputType | DMMF.SchemaArg;
dbNames?: string[] | null;
isGenerated: boolean;
hasDefaultValue: boolean;
default?: FieldDefault | string | boolean | number;
relationToFields?: any[];
relationOnDelete?: string;
relationName?: string;
documentation?: string;
[key: string]: any;
}
interface FieldDefault {
name: string;
args: any[];
}
interface Schema {
rootQueryType?: string;
rootMutationType?: string;
inputObjectTypes: {
model?: InputType[];
prisma: InputType[];
};
outputObjectTypes: {
model: OutputType[];
prisma: OutputType[];
};
enumTypes: {
model?: SchemaEnum[];
prisma: SchemaEnum[];
};
}
interface Query {
name: string;
args: SchemaArg[];
output: QueryOutput;
}
interface QueryOutput {
name: string;
isRequired: boolean;
isList: boolean;
}
type ArgType = string | InputType | SchemaEnum;
interface SchemaArgInputType {
isList: boolean;
type: ArgType;
location: FieldLocation;
namespace?: FieldNamespace;
}
interface SchemaArg {
name: string;
comment?: string;
isNullable: boolean;
isRequired: boolean;
inputTypes: SchemaArgInputType[];
deprecation?: Deprecation;
}
interface OutputType {
name: string;
fields: SchemaField[];
fieldMap?: Record<string, SchemaField>;
}
interface SchemaField {
name: string;
isNullable?: boolean;
outputType: {
type: string | OutputType | SchemaEnum;
isList: boolean;
location: FieldLocation;
namespace?: FieldNamespace;
};
args: SchemaArg[];
deprecation?: Deprecation;
documentation?: string;
}
interface Deprecation {
sinceVersion: string;
reason: string;
plannedRemovalVersion?: string;
}
interface InputType {
name: string;
constraints: {
maxNumFields: number | null;
minNumFields: number | null;
};
fields: SchemaArg[];
fieldMap?: Record<string, SchemaArg>;
}
interface ModelMapping {
model: string;
plural: string;
findUnique?: string | null;
findFirst?: string | null;
findMany?: string | null;
create?: string | null;
createMany?: string | null;
update?: string | null;
updateMany?: string | null;
upsert?: string | null;
delete?: string | null;
deleteMany?: string | null;
aggregate?: string | null;
groupBy?: string | null;
count?: string | null;
}
enum ModelAction {
findUnique = "findUnique",
findFirst = "findFirst",
findMany = "findMany",
create = "create",
createMany = "createMany",
update = "update",
updateMany = "updateMany",
upsert = "upsert",
delete = "delete",
deleteMany = "deleteMany",
groupBy = "groupBy",
count = "count",
aggregate = "aggregate"
}
}
do4gr
Yaakov
01/10/2022, 4:07 PMprisma migrate deploy
or must I also run prisma generate
?Barnaby
01/26/2022, 1:35 PMAltered column `slug` (type changed)
Barnaby
01/26/2022, 1:44 PM?
to the type, the error during migrate changed from Required to Nullable
still appears so I think that's a bugKen
02/03/2022, 3:14 AMManthan Mallikarjun
01/30/2022, 5:02 AMdb seed
locally to my production database, it finishes in about 5-10 seconds. When I run it on Github Actions with pretty much the exact same settings it takes almost 50+ seconds. It must be some sort of connection stuff, or maybe lower number of cores, or poor connection, but is there any way i can start to debug it?Oleg Yarin
01/30/2022, 3:16 PMFrederik
02/02/2022, 2:00 PM3.9.0
we shipped migrate diff
in preview which is a bit like a swiss army knife for migrations. The tool allows you to diff
• Prisma schemas
• your migration history and
• database schemas
in any combination and returns a script or a human readable representation of the diff. As a companion we added db execute
which can be used to send the resulting script to a database.
We believe this is a game changer troubleshooting all sorts of migration use cases. But please take a look and let us know what you think 🙏
Some documentation can be found here and we are working on more!Tyler Bell
02/08/2022, 2:10 PMmodel Plan {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime? @updatedAt
name String
description String?
status PlanStatus @default(DRAFT)
}
enum PlanStatus {
LIVE
DRAFT
}
and I want to change it to….
model Plan {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime? @updatedAt
name String
description String?
status PlanStatus @default(ACTIVE)
}
enum PlanStatus {
ACTIVE
INACTIVE
}
Essentially I want to change LIVE
-> ACTIVE
and DRAFT
-> INACTIVE
At the moment my current plan is to…
1. add ACTIVE and INACTIVE to the PlanStatus enum such that I would have.
enum PlanStatus {
ACTIVE
INACTIVE
LIVE
DRAFT
}
2. migrate DB
3. run a script that would update all LIVE values to ACTIVE and all DRAFT values to INACTIVE
4. remove LIVE and DRAFT from my schema
enum PlanStatus {
ACTIVE
INACTIVE
}
5. migrate again
I’m hoping there is a cleaner way to achieve is 🙂
Thanks!Carlos Gomez
02/10/2022, 11:58 PMstrong_migrations
for Prisma? https://github.com/ankane/strong_migrationsMushfau Saeed
02/16/2022, 4:24 PM$ prisma migrate down --experimental
Error: The current command "down" doesn't exist in the new version of Prisma Migrate.
$ prisma -v
Environment variables loaded from .env
prisma : 3.9.2
@prisma/client : 3.9.2
Current platform : windows
Query Engine (Node-API) : libquery-engine bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at ..\..\node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine : migration-engine-cli bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at ..\..\node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at ..\..\node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at ..\..\node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : bcc2ff906db47790ee902e7bbc76d7ffb1893009
Studio : 0.457.0
Kiran
02/28/2022, 1:58 PMKiran
02/28/2022, 1:58 PMKiran
03/01/2022, 3:30 PMError: P3014
Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at <https://pris.ly/d/migrate-shadow>
Original error:
db error: ERROR: permission denied to create database
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:363
1: migration_core::state::DevDiagnostic
at migration-engine/core/src/state.rs:178
How can I solve this bug? Any hint is much appreciatedKiran
03/01/2022, 3:33 PMMeyer BTS
03/07/2022, 11:10 PM