WaspW
Wasp2y ago
JakeLoew

migrate-dev failure when adding property to entity

Trying to perform a migration where I add an optional field to User, but since there already exist users in the DB the migration fails. For example:

Migrating from:
entity User {=psl
  id       Int        @id @default(autoincrement())
  email    String?    @unique
psl=}


To:
entity User {=psl
  id       Int        @id @default(autoincrement())
  email    String?    @unique
  myField  String?
psl=}


run wasp db migrate-dev

Fails with
error TS2741: Property 'myField' is missing in type '{ email: string; }' but required in type 'Omit<GetResult<{ id: number; email: string; myField: string; }, unknown> & {}, "id">'.


Wasp version: 0.13.2 (entities defined in main.wasp)
Was this page helpful?