Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid_generate_v4() error after the first migration is passed #10912

Closed
Tracked by #19381
jeromeSH26 opened this issue Dec 31, 2021 · 3 comments
Closed
Tracked by #19381

uuid_generate_v4() error after the first migration is passed #10912

jeromeSH26 opened this issue Dec 31, 2021 · 3 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. tech/engines Issue for tech Engines. topic: postgresql topic: postgresqlExtensions topic: prisma migrate dev CLI: prisma migrate dev

Comments

@jeromeSH26
Copy link

Bug description

Have introspected an existing postgresdb and ran the migration for the first time, to recreate the DB in another instance.
every thing went fine.

Running another migration immediatly after, without changing anything in the schema.prisma file, I got this error

Migration `20211231135328_init` failed to apply cleanly to the shadow database. 
Error:
db error: ERROR: function public.uuid_generate_v4() does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

of course the extension "uuid-ossp" is installed in the server, otherwise the first migration would have failed.
What's wrong ?
I've seen many topics related to this error, but the problem is not that the uuid-ossp extension is not installed.
The problem is that the migration doesn't work although the model hasn't been changed at all

running prisma 3.7

How to reproduce

run the schema below twice

Expected behavior

No response

Prisma information

here the whole schema

generator client {
  provider = "prisma-client-js"
  output   = "../src/generated/client"
}


datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model actualites_old {
  id              String   @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  companyId       BigInt
  createdBy       BigInt?
  createDate      String?  @db.VarChar(10000)
  modifiedBy      BigInt?
  modifiedDate    String?  @db.VarChar(10000)
  actualiteId     BigInt
  groupId         BigInt?
  actionStartDate String?  @db.VarChar(10000)
  actionEndDate   String?  @db.VarChar(10000)
  content         String?
  upDateDate      String?  @db.VarChar(10000)
  alert           Boolean?
  action          Boolean?
  priority        Float?
  actionType      String?  @db.VarChar(10000)
  unpublished     Boolean?
  articleId       String?  @db.VarChar(10000)

  @@id([id, actualiteId], map: "PK_9319f31603a13d780629ce94a66")
  @@index([id], map: "IDX_184cf7262cfe11d7bf7a85ad68")
}

model apigeestores {
  id                             String  @id(map: "PK_d834830f102620c04b090b0062d") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  stoEan                         String  @unique(map: "UQ_3f8da28378e0853857b9a9cad4a") @db.VarChar(300)
  stoAnabelKey                   String? @default("") @db.VarChar(1000)
  stoPlgCliCode                  String? @default("") @db.VarChar(1000)
  stoPlgCliKey                   String? @default("") @db.VarChar(1000)
  countryCode                    String? @default("") @db.VarChar(1000)
  aclGesKey                      String? @default("") @db.VarChar(1000)
  stoMainCode                    String? @default("") @db.VarChar(1000)
  stoFinKey                      String? @default("") @db.VarChar(1000)
  storeDesc                      String? @default("") @db.VarChar(1000)
  stoDisplayDesc                 String? @default("") @db.VarChar(1000)
  address1                       String? @default("") @db.VarChar(1000)
  address2                       String? @default("") @db.VarChar(1000)
  postcode                       String? @default("") @db.VarChar(1000)
  town                           String? @default("") @db.VarChar(1000)
  phoneNumber                    String? @default("") @db.VarChar(1000)
  faxNumber                      String? @default("") @db.VarChar(1000)
  stoOpenDate                    String? @default("") @db.VarChar(1000)
  nonActiveDate                  String? @default("") @db.VarChar(1000)
  createDate                     String? @default("") @db.VarChar(1000)
  deleteDate                     String? @default("") @db.VarChar(1000)
  storeSalSize                   String? @default("") @db.VarChar(1000)
  drivePickingFlag               String? @default("") @db.VarChar(1000)
  gasStationFlag                 String? @default("") @db.VarChar(1000)
  stoPsarKey                     String? @default("") @db.VarChar(1000)
  stoIntFlag                     String? @default("") @db.VarChar(1000)
  stoIntDesc                     String? @default("") @db.VarChar(1000)
  stoIntUpdateDate               String? @default("") @db.VarChar(1000)
  chainTypeOpKey                 String? @default("") @db.VarChar(1000)
  chainTypeOpDesc                String? @default("") @db.VarChar(1000)
  buCadanaKey                    String? @default("") @db.VarChar(1000)
  buThalesKey                    String? @default("") @db.VarChar(1000)
  buDesc                         String? @default("") @db.VarChar(1000)
  buUpdateDate                   String? @default("") @db.VarChar(1000)
  chainOpKey                     String? @default("") @db.VarChar(1000)
  chainOpDesc                    String? @default("") @db.VarChar(1000)
  chainOpUpdateDate              String? @default("") @db.VarChar(1000)
  aclGrpKey                      String? @default("") @db.VarChar(1000)
  aclGrpDesc                     String? @default("") @db.VarChar(1000)
  regionKey                      String? @default("") @db.VarChar(1000)
  regionDesc                     String? @default("") @db.VarChar(1000)
  satelliteKey                   String? @default("") @db.VarChar(1000)
  satelliteDesc                  String? @default("") @db.VarChar(1000)
  zoneKey                        String? @default("") @db.VarChar(1000)
  zoneDesc                       String? @default("") @db.VarChar(1000)
  entKey                         String? @default("") @db.VarChar(1000)
  entDesc                        String? @default("") @db.VarChar(1000)
  opeGrpKey                      String? @default("") @db.VarChar(1000)
  opeGrpDesc                     String? @default("") @db.VarChar(1000)
  taxZoneKey                     String? @default("") @db.VarChar(1000)
  taxZoneDesc                    String? @default("") @db.VarChar(1000)
  stoSimGrpKey                   String? @default("") @db.VarChar(1000)
  stoSimGrpDesc                  String? @default("") @db.VarChar(1000)
  chainTypeKey                   String? @default("") @db.VarChar(1000)
  chainTypeDesc                  String? @default("") @db.VarChar(1000)
  stoAticaCode                   String? @default("") @db.VarChar(1000)
  stoSmacKey                     String? @default("") @db.VarChar(1000)
  bcpRegionKey                   String? @default("") @db.VarChar(1000)
  bcpRegionDesc                  String? @default("") @db.VarChar(1000)
  bcpChainKey                    String? @default("") @db.VarChar(1000)
  bcpChainDesc                   String? @default("") @db.VarChar(1000)
  chainKey                       String? @default("") @db.VarChar(1000)
  chainDesc                      String? @default("") @db.VarChar(1000)
  bcpBannerKey                   String? @default("") @db.VarChar(1000)
  bcpBannerDesc                  String? @default("") @db.VarChar(1000)
  bcpEntKey                      String? @default("") @db.VarChar(1000)
  bcpEntDesc                     String? @default("") @db.VarChar(1000)
  payrollFacilityKey             String? @default("") @db.VarChar(1000)
  geoLocation                    Json?   @default("{}")
  storeURI                       String? @default("") @db.VarChar(1000)
  openingExceptionCalendar       String? @default("")
  openingWeekPattern             String? @default("")
  alcoholStockingAccreditationId String? @default("") @db.VarChar(1000)
  financialClosingMonth          String? @default("") @db.VarChar(1000)
  financialClosingLastDate       String? @default("") @db.VarChar(1000)
  alcoholFeesTypeCode            String? @default("") @db.VarChar(1000)
  alcoholFeesTypeUpdateDate      String? @default("") @db.VarChar(1000)
  supplierInvoiceControl         String? @default("") @db.VarChar(1000)
  intraGroupInvoiceGeneration    String? @default("") @db.VarChar(1000)
  companyName                    String? @default("") @db.VarChar(1000)
  bankCode                       String? @default("") @db.VarChar(1000)
  companyRegistrationNumber      String? @default("") @db.VarChar(1000)
  siteRegistrationNumber         String? @default("") @db.VarChar(1000)
  legalStructure                 String? @default("") @db.VarChar(1000)
  legalRegistration              String? @default("") @db.VarChar(1000)
  issuedCapital                  String? @default("") @db.VarChar(1000)
  structChainOpKey               String? @default("") @db.VarChar(1000)
  mainAclGesKey                  String? @default("") @db.VarChar(1000)
  mainStoFinKey                  String? @default("") @db.VarChar(1000)
  stoCashRegisterCode            String? @default("") @db.VarChar(1000)

  @@index([id], map: "IDX_d834830f102620c04b090b0062")
}

model application_users {
  id            String    @id(map: "PK_1b3b3fd01d876c9eca261218863") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  email         String    @unique(map: "UQ_924af55ea0a9b45b5a0a0c04f06") @default("") @db.VarChar(1000)
  firstName     String?   @default("") @db.VarChar(1000)
  lastName      String?   @default("") @db.VarChar(1000)
  avatarUrl     String?   @default("") @db.VarChar(1000)
  isAdmin       Boolean?  @default(false)
  creationDate  DateTime? @default(dbgenerated("'2021-12-29 17:02:15.524'::timestamp without time zone")) @db.Timestamp(6)
  lastLoginDate DateTime? @default(dbgenerated("'2021-12-29 17:02:15.524'::timestamp without time zone")) @db.Timestamp(6)

  @@index([id], map: "IDX_1b3b3fd01d876c9eca26121886")
}

model articles {
  id                            String                          @id(map: "PK_0a6e2c450d83e0b6052c2793334") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  title                         String?                         @default("") @db.VarChar(3000)
  prioriteId                    String?                         @db.Uuid
  isAlerte                      Boolean?                        @default(false)
  categorieId                   String?                         @db.Uuid
  publicationStartDate          DateTime?                       @default(dbgenerated("'2021-12-29 17:02:14.651'::timestamp without time zone")) @db.Timestamp(6)
  publicationEndDate            DateTime?                       @default(dbgenerated("'2021-12-29 17:02:14.651'::timestamp without time zone")) @db.Timestamp(6)
  hasAction                     Boolean?                        @default(false)
  briefDescription              String?                         @default("") @db.VarChar(3000)
  content                       String?                         @default("")
  contact1                      String?                         @default("") @db.VarChar(300)
  contact2                      String?                         @default("") @db.VarChar(300)
  author                        String?                         @default("") @db.VarChar(300)
  recordCreationDate            DateTime                        @default(now()) @db.Timestamp(6)
  recordUpdateDate              DateTime                        @default(now()) @db.Timestamp(6)
  ref_categories                ref_categories?                 @relation(fields: [categorieId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_278d87b271a80d56e5d6cc0f888")
  ref_priorites                 ref_priorites?                  @relation(fields: [prioriteId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_a55acd217d26e0d60f57b5f38f7")
  articles_documents            articles_documents[]
  articles_fonctions            articles_fonctions[]
  articles_magasins             articles_magasins[]
  articles_metiers              articles_metiers[]
  articles_perimetres           articles_perimetres[]
  articles_poles                articles_poles[]
  articles_services             articles_services[]
  articles_statuts_contribution articles_statuts_contribution[]

  @@index([id], map: "IDX_0a6e2c450d83e0b6052c279333")
}

model articles_documents {
  articleId      String         @db.Uuid
  documentId     String         @db.Uuid
  uploadedDate   DateTime       @default(dbgenerated("'2021-12-29 17:02:14.479'::timestamp without time zone")) @db.Timestamp(6)
  author         String         @db.VarChar(3000)
  description    String?
  articles       articles       @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_aa07fddf7abbf74ab8ed17a6b12")
  base_documents base_documents @relation(fields: [documentId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_2b3cc820d3f9a2c9767bd4219fc")

  @@id([articleId, documentId], map: "PK_d85361dbe34ee4177c69b435847")
  @@index([documentId], map: "IDX_2b3cc820d3f9a2c9767bd4219f")
  @@index([articleId], map: "IDX_aa07fddf7abbf74ab8ed17a6b1")
}

model articles_fonctions {
  articleId     String        @db.Uuid
  fonctionId    String        @db.Uuid
  articles      articles      @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_43128a90c1671f1639d23ea3d5e")
  ref_fonctions ref_fonctions @relation(fields: [fonctionId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_f42358a7091bc79819c714987e4")
  createdAt     DateTime @default(now())

  @@id([articleId, fonctionId], map: "PK_ec426023a0eda73ac198bdc6046")
  @@index([articleId], map: "IDX_43128a90c1671f1639d23ea3d5")
  @@index([fonctionId], map: "IDX_f42358a7091bc79819c714987e")
}

model articles_json {
  id     String @id(map: "PK_bdccc5207a1549f421d58b7585e") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  stores Json?

  @@index([id], map: "IDX_bdccc5207a1549f421d58b7585")
}

model articles_magasins {
  articleId           String              @db.Uuid
  magasinId           String              @db.Uuid
  articles            articles            @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_ab3f23b90f0a94e199a47f2319f")
  hypermarches_stores hypermarches_stores @relation(fields: [magasinId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_612628cb7db6adc94b4c0ddd3a0")
    createdAt     DateTime @default(now())

  @@id([articleId, magasinId], map: "PK_5819079d610faea6dfe1e149e2a")
  @@index([magasinId], map: "IDX_612628cb7db6adc94b4c0ddd3a")
  @@index([articleId], map: "IDX_ab3f23b90f0a94e199a47f2319")
}

model articles_metiers {
  articleId   String      @db.Uuid
  metierId    String      @db.Uuid
  articles    articles    @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_9a9406d399cd666f04a6a0f536e")
  ref_metiers ref_metiers @relation(fields: [metierId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_f31dada9157fe3bc9c449655211")
    createdAt     DateTime @default(now())

  @@id([articleId, metierId], map: "PK_64be4373bc295c10ee9777dcd4a")
  @@index([articleId], map: "IDX_9a9406d399cd666f04a6a0f536")
  @@index([metierId], map: "IDX_f31dada9157fe3bc9c44965521")
}

model articles_perimetres {
  articleId      String         @db.Uuid
  perimetreId    String         @db.Uuid
  articles       articles       @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_cf9f46cdd645bf6680bb88fa11a")
  ref_perimetres ref_perimetres @relation(fields: [perimetreId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_52bf3a13eea2273bd5872067274")

  @@id([articleId, perimetreId], map: "PK_f05de224ff7498b8e621bf20bae")
  @@index([perimetreId], map: "IDX_52bf3a13eea2273bd587206727")
  @@index([articleId], map: "IDX_cf9f46cdd645bf6680bb88fa11")

  createdAt     DateTime @default(now())
}

model articles_poles {
  articleId String    @db.Uuid
  poleId    String    @db.Uuid
  articles  articles  @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_dbfffd18ec2c4d607309ea99427")
  ref_poles ref_poles @relation(fields: [poleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_88188609aa3cb1f7e1434e49a0a")

  @@id([articleId, poleId], map: "PK_b7a637624fc97d2bac600f557be")
  @@index([articleId], map: "IDX_dbfffd18ec2c4d607309ea9942")

  createdAt     DateTime @default(now())
}

model articles_services {
  articleId    String       @db.Uuid
  serviceId    String       @db.Uuid
  articles     articles     @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_ab1cbbcb10652eb91c112450060")
  ref_services ref_services @relation(fields: [serviceId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_032afde479d86c5eb6fa0f9e780")

  @@id([articleId, serviceId], map: "PK_0dfb95fc8a5364647e6093d8f7c")
  @@index([serviceId], map: "IDX_032afde479d86c5eb6fa0f9e78")
  @@index([articleId], map: "IDX_ab1cbbcb10652eb91c11245006")

  createdAt     DateTime @default(now())
}

model articles_statuts_contribution {
  articleId           String              @db.Uuid
  statutId            String              @db.Uuid
  statutDate          DateTime            @db.Timestamp(6)
  author              String              @db.VarChar(3000)
  description         String?
  isLastStatut        Boolean             @default(false)
  articles            articles            @relation(fields: [articleId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_d637010e788c4983ea307c94fdf")
  ref_statuts_contrib ref_statuts_contrib @relation(fields: [statutId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_9509956f5883f59af9047732439")

  @@id([articleId, statutId, statutDate], map: "PK_d79307a2c3984bb233d1e44e0be")
  @@index([statutId], map: "IDX_9509956f5883f59af904773243")
  @@index([statutDate], map: "IDX_cfc16e0483f99ce0b71e8feed7")
  @@index([articleId], map: "IDX_d637010e788c4983ea307c94fd")
}

model base_documents {
  id                 String               @id(map: "PK_87eab207e6374a967ae94feb8eb") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  initialName        String               @db.VarChar(3000)
  uploadUrl          String               @db.VarChar(3000)
  uploadName         String               @db.VarChar(3000)
  type               String               @db.VarChar(3000)
  uploadedDate       DateTime             @default(dbgenerated("'2021-12-29 17:02:14.478'::timestamp without time zone")) @db.Timestamp(6)
  author             String               @db.VarChar(3000)
  description        String?
  articles_documents articles_documents[]

  @@index([id], map: "IDX_87eab207e6374a967ae94feb8e")
}

model hypermarches_stores {
  id                             String                   @id(map: "PK_7b1178bff8dc98cbd6d68fc2dd0") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  stoEan                         String                   @unique(map: "UQ_7fddfa16362979011e27b4d0b21") @db.VarChar(300)
  stoAnabelKey                   String?                  @default("") @db.VarChar(1000)
  stoPlgCliCode                  String?                  @default("") @db.VarChar(1000)
  stoPlgCliKey                   String?                  @default("") @db.VarChar(1000)
  countryCode                    String?                  @default("") @db.VarChar(1000)
  aclGesKey                      String?                  @default("") @db.VarChar(1000)
  stoMainCode                    String?                  @default("") @db.VarChar(1000)
  stoFinKey                      String?                  @default("") @db.VarChar(1000)
  storeDesc                      String?                  @default("") @db.VarChar(1000)
  stoDisplayDesc                 String?                  @default("") @db.VarChar(1000)
  address1                       String?                  @default("") @db.VarChar(1000)
  address2                       String?                  @default("") @db.VarChar(1000)
  postcode                       String?                  @default("") @db.VarChar(1000)
  town                           String?                  @default("") @db.VarChar(1000)
  phoneNumber                    String?                  @default("") @db.VarChar(1000)
  faxNumber                      String?                  @default("") @db.VarChar(1000)
  stoOpenDate                    String?                  @default("") @db.VarChar(1000)
  nonActiveDate                  String?                  @default("") @db.VarChar(1000)
  createDate                     String?                  @default("") @db.VarChar(1000)
  deleteDate                     String?                  @default("") @db.VarChar(1000)
  storeSalSize                   String?                  @default("") @db.VarChar(1000)
  drivePickingFlag               String?                  @default("") @db.VarChar(1000)
  gasStationFlag                 String?                  @default("") @db.VarChar(1000)
  stoPsarKey                     String?                  @default("") @db.VarChar(1000)
  stoIntFlag                     String?                  @default("") @db.VarChar(1000)
  stoIntDesc                     String?                  @default("") @db.VarChar(1000)
  stoIntUpdateDate               String?                  @default("") @db.VarChar(1000)
  chainTypeOpKey                 String?                  @default("") @db.VarChar(1000)
  chainTypeOpDesc                String?                  @default("") @db.VarChar(1000)
  buCadanaKey                    String?                  @default("") @db.VarChar(1000)
  buThalesKey                    String?                  @default("") @db.VarChar(1000)
  buDesc                         String?                  @default("") @db.VarChar(1000)
  buUpdateDate                   String?                  @default("") @db.VarChar(1000)
  chainOpKey                     String?                  @default("") @db.VarChar(1000)
  chainOpDesc                    String?                  @default("") @db.VarChar(1000)
  chainOpUpdateDate              String?                  @default("") @db.VarChar(1000)
  aclGrpKey                      String?                  @default("") @db.VarChar(1000)
  aclGrpDesc                     String?                  @default("") @db.VarChar(1000)
  regionKey                      String?                  @default("") @db.VarChar(1000)
  regionDesc                     String?                  @default("") @db.VarChar(1000)
  satelliteKey                   String?                  @default("") @db.VarChar(1000)
  satelliteDesc                  String?                  @default("") @db.VarChar(1000)
  zoneKey                        String?                  @default("") @db.VarChar(1000)
  zoneDesc                       String?                  @default("") @db.VarChar(1000)
  entKey                         String?                  @default("") @db.VarChar(1000)
  entDesc                        String?                  @default("") @db.VarChar(1000)
  opeGrpKey                      String?                  @default("") @db.VarChar(1000)
  opeGrpDesc                     String?                  @default("") @db.VarChar(1000)
  taxZoneKey                     String?                  @default("") @db.VarChar(1000)
  taxZoneDesc                    String?                  @default("") @db.VarChar(1000)
  stoSimGrpKey                   String?                  @default("") @db.VarChar(1000)
  stoSimGrpDesc                  String?                  @default("") @db.VarChar(1000)
  chainTypeKey                   String?                  @default("") @db.VarChar(1000)
  chainTypeDesc                  String?                  @default("") @db.VarChar(1000)
  stoAticaCode                   String?                  @default("") @db.VarChar(1000)
  stoSmacKey                     String?                  @default("") @db.VarChar(1000)
  bcpRegionKey                   String?                  @default("") @db.VarChar(1000)
  bcpRegionDesc                  String?                  @default("") @db.VarChar(1000)
  bcpChainKey                    String?                  @default("") @db.VarChar(1000)
  bcpChainDesc                   String?                  @default("") @db.VarChar(1000)
  chainKey                       String?                  @default("") @db.VarChar(1000)
  chainDesc                      String?                  @default("") @db.VarChar(1000)
  bcpBannerKey                   String?                  @default("") @db.VarChar(1000)
  bcpBannerDesc                  String?                  @default("") @db.VarChar(1000)
  bcpEntKey                      String?                  @default("") @db.VarChar(1000)
  bcpEntDesc                     String?                  @default("") @db.VarChar(1000)
  payrollFacilityKey             String?                  @default("") @db.VarChar(1000)
  geoLocation                    Json?                    @default("{}")
  storeURI                       String?                  @default("") @db.VarChar(1000)
  alcoholStockingAccreditationId String?                  @default("") @db.VarChar(1000)
  financialClosingMonth          String?                  @default("") @db.VarChar(1000)
  financialClosingLastDate       String?                  @default("") @db.VarChar(1000)
  alcoholFeesTypeCode            String?                  @default("") @db.VarChar(1000)
  alcoholFeesTypeUpdateDate      String?                  @default("") @db.VarChar(1000)
  supplierInvoiceControl         String?                  @default("") @db.VarChar(1000)
  intraGroupInvoiceGeneration    String?                  @default("") @db.VarChar(1000)
  companyName                    String?                  @default("") @db.VarChar(1000)
  bankCode                       String?                  @default("") @db.VarChar(1000)
  companyRegistrationNumber      String?                  @default("") @db.VarChar(1000)
  siteRegistrationNumber         String?                  @default("") @db.VarChar(1000)
  legalStructure                 String?                  @default("") @db.VarChar(1000)
  legalRegistration              String?                  @default("") @db.VarChar(1000)
  issuedCapital                  String?                  @default("") @db.VarChar(1000)
  structChainOpKey               String?                  @default("") @db.VarChar(1000)
  mainAclGesKey                  String?                  @default("") @db.VarChar(1000)
  mainStoFinKey                  String?                  @default("") @db.VarChar(1000)
  stoCashRegisterCode            String?                  @default("") @db.VarChar(1000)
  articles_magasins              articles_magasins[]
  magasins_articles_json         magasins_articles_json[]

  @@index([id], map: "IDX_7b1178bff8dc98cbd6d68fc2dd")
}

model hypermarches_stores_weather {
  id        String @id(map: "PK_4fcb6f843d08989b3f473a6b8fb") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  stoEan    String @db.VarChar(300)
  forecasts Json?

  @@index([id], map: "IDX_4fcb6f843d08989b3f473a6b8f")
}

model magasins_articles_json {
  id                  String              @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  magasinId           String              @db.Uuid
  articles            Json?
  hypermarches_stores hypermarches_stores @relation(fields: [magasinId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_850ed4588a24bd455b0850f83da")

  @@id([id, magasinId], map: "PK_0fec34284552a9ed0680bfabf14")
  @@index([id], map: "IDX_4ef0abbe3ea5df4efe8859af05")
}

model ref_bassins {
  id      String @id(map: "PK_f6ab63e541f91d3a38fd3542f0a") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section String @db.VarChar(300)
  key     String @db.VarChar(300)
  value   String @db.VarChar(300)
  parent  String @db.VarChar(300)
  order   Int

  @@index([id], map: "IDX_f6ab63e541f91d3a38fd3542f0")
}

model ref_categories {
  id       String     @id(map: "PK_2ed0ec18256b28a1d6c1acd53c5") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section  String     @db.VarChar(300)
  key      String     @db.VarChar(300)
  value    String     @db.VarChar(300)
  parent   String     @db.VarChar(300)
  order    Int
  articles articles[]

  @@index([id], map: "IDX_2ed0ec18256b28a1d6c1acd53c")
}

model ref_fonctions {
  id                 String               @id(map: "PK_a3459183118f6e9ab892e8fbc40") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section            String               @db.VarChar(300)
  key                String               @db.VarChar(300)
  value              String               @db.VarChar(300)
  parent             String               @db.VarChar(300)
  order              Int
  articles_fonctions articles_fonctions[]

  @@index([id], map: "IDX_a3459183118f6e9ab892e8fbc4")
}

model ref_integres_franchises {
  id      String @id(map: "PK_9ce95471b11f41c33630cedb40d") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section String @db.VarChar(300)
  key     String @db.VarChar(300)
  value   String @db.VarChar(300)
  parent  String @db.VarChar(300)
  order   Int

  @@index([id], map: "IDX_9ce95471b11f41c33630cedb40")
}

model ref_metiers {
  id               String             @id(map: "PK_24035e57be39b22b5ee482f4a72") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section          String             @db.VarChar(300)
  key              String             @db.VarChar(300)
  value            String             @db.VarChar(300)
  parent           String             @db.VarChar(300)
  order            Int
  articles_metiers articles_metiers[]

  @@index([id], map: "IDX_24035e57be39b22b5ee482f4a7")
}

model ref_perimetres {
  id                  String                @id(map: "PK_892a4789fa78ed777d483bbf2c7") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section             String                @db.VarChar(300)
  key                 String                @db.VarChar(300)
  value               String                @db.VarChar(300)
  parent              String                @db.VarChar(300)
  order               Int
  articles_perimetres articles_perimetres[]

  @@index([id], map: "IDX_892a4789fa78ed777d483bbf2c")
}

model ref_poles {
  id             String           @id(map: "PK_bef85d57185266125c837256130") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section        String           @db.VarChar(300)
  key            String           @db.VarChar(300)
  value          String           @db.VarChar(300)
  parent         String           @db.VarChar(300)
  order          Int
  articles_poles articles_poles[]

  @@index([id], map: "IDX_bef85d57185266125c83725613")
}

model ref_priorites {
  id       String     @id(map: "PK_46b20e5bc1e869910538cccc774") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section  String     @db.VarChar(300)
  key      String     @db.VarChar(300)
  value    String     @db.VarChar(300)
  parent   String     @db.VarChar(300)
  order    Int
  articles articles[]

  @@index([id], map: "IDX_46b20e5bc1e869910538cccc77")
}

model ref_regions {
  id      String @id(map: "PK_353ad1225bbc068586cca8250aa") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section String @db.VarChar(300)
  key     String @db.VarChar(300)
  value   String @db.VarChar(300)
  parent  String @db.VarChar(300)
  order   Int

  @@index([id], map: "IDX_353ad1225bbc068586cca8250a")
}

model ref_services {
  id                String              @id(map: "PK_07dbe5048e9dd38bcecd09bd27a") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section           String              @db.VarChar(300)
  key               String              @db.VarChar(300)
  value             String              @db.VarChar(300)
  parent            String              @db.VarChar(300)
  order             Int
  articles_services articles_services[]

  @@index([id], map: "IDX_07dbe5048e9dd38bcecd09bd27")
}

model ref_statuts_contrib {
  id                            String                          @id(map: "PK_922dfc59383be12b6bb3888341b") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section                       String                          @db.VarChar(300)
  key                           String                          @db.VarChar(300)
  value                         String                          @db.VarChar(300)
  parent                        String                          @db.VarChar(300)
  order                         Int
  articles_statuts_contribution articles_statuts_contribution[]

  @@index([id], map: "IDX_922dfc59383be12b6bb3888341")
}

model ref_table {
  id      String @id(map: "PK_cf0eb56fe173ae70b9435c238bd") @default(dbgenerated("public.uuid_generate_v4()")) @db.Uuid
  section String @db.VarChar(300)
  key     String @db.VarChar(300)
  value   String @db.VarChar(300)
  parent  String @db.VarChar(300)
  order   Int

  @@index([id], map: "IDX_cf0eb56fe173ae70b9435c238b")
}

Environment & setup

postgres 12, node 16.4

Prisma Version

3.7
@jeromeSH26 jeromeSH26 added the kind/bug A reported bug. label Dec 31, 2021
@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. topic: prisma migrate dev CLI: prisma migrate dev topic: postgresql topic: postgresqlExtensions labels Dec 31, 2021
@janpio
Copy link
Member

janpio commented Dec 31, 2021

Migration `20211231135328_init` failed to apply cleanly to the shadow database.

From this error message I can assume you are using prisma migrate dev (or a related command) to migrate the database. That uses a shadow database to get the state the database should be in per the migration files - and that one probably by default does not have the extension enabled and Prisma has no good concept on how to do that yet unfortunately.

Did you enable the extension manually on your main database or via the migration that initially created the database?

@jeromeSH26
Copy link
Author

jeromeSH26 commented Jan 1, 2022 via email

@janpio janpio added the tech/engines Issue for tech Engines. label Mar 24, 2022
@SevInf
Copy link
Contributor

SevInf commented Jul 13, 2023

Hello everyone!
This problem should be fixed with postgresqlExtensions preview feature. I am going to close this issue now, please, report any problems you encounter with this feature in #15835 or create separate issues.

@SevInf SevInf closed this as completed Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. tech/engines Issue for tech Engines. topic: postgresql topic: postgresqlExtensions topic: prisma migrate dev CLI: prisma migrate dev
Projects
None yet
Development

No branches or pull requests

4 participants
@janpio @SevInf @jeromeSH26 and others