# _Migration

name: 20200819140706
status: MigrationSuccess
errors: []
datamodel:
datasource db {
  provider = "sqlite"
  url      = "***"
  default  = true
}

model Person {
  id    String @id @default(cuid())
  name  String
  sales Sale[] @relation("PersonsOnSale", references: [id])
}

model Sale {
  id      String   @id @default(cuid())
  date    DateTime
  persons Person[] @relation("PersonsOnSale", references: [id])
}

datamodel_steps:
[{"tag":"CreateSource","source":"db"},{"tag":"CreateArgument","location":{"tag":"Source","source":"db"},"argument":"provider","value":"\"sqlite\""},{"tag":"CreateArgument","location":{"tag":"Source","source":"db"},"argument":"url","value":"\"***\""},{"tag":"CreateArgument","location":{"tag":"Source","source":"db"},"argument":"default","value":"true"},{"tag":"CreateModel","model":"Person"},{"tag":"CreateField","model":"Person","field":"id","type":"String","arity":"Required"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Person","field":"id"},"directive":"id"}},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Person","field":"id"},"directive":"default"}},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Person","field":"id"},"directive":"default"},"argument":"","value":"cuid()"},{"tag":"CreateField","model":"Person","field":"name","type":"String","arity":"Required"},{"tag":"CreateField","model":"Person","field":"sales","type":"Sale","arity":"List"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Person","field":"sales"},"directive":"relation"}},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Person","field":"sales"},"directive":"relation"},"argument":"","value":"\"PersonsOnSale\""},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Person","field":"sales"},"directive":"relation"},"argument":"references","value":"[id]"},{"tag":"CreateModel","model":"Sale"},{"tag":"CreateField","model":"Sale","field":"id","type":"String","arity":"Required"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Sale","field":"id"},"directive":"id"}},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Sale","field":"id"},"directive":"default"}},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Sale","field":"id"},"directive":"default"},"argument":"","value":"cuid()"},{"tag":"CreateField","model":"Sale","field":"date","type":"DateTime","arity":"Required"},{"tag":"CreateField","model":"Sale","field":"persons","type":"Person","arity":"List"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Sale","field":"persons"},"directive":"relation"}},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Sale","field":"persons"},"directive":"relation"},"argument":"","value":"\"PersonsOnSale\""},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Sale","field":"persons"},"directive":"relation"},"argument":"references","value":"[id]"}]

database_migration:
{"before":{"tables":[{"name":"_Migration","columns":[{"name":"revision","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true},{"name":"name","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"status","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"applied","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"rolled_back","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel_steps","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"database_migration","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"errors","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"started_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"finished_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["revision"],"sequence":null,"constraintName":null},"foreignKeys":[]}],"enums":[],"sequences":[]},"after":{"tables":[{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"},{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}],"enums":[],"sequences":[]},"steps":[{"CreateTable":{"table":{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]}}},{"CreateTable":{"table":{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]}}},{"CreateTable":{"table":{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"},{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}}},{"CreateIndex":{"table":"_PersonsOnSale","index":{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"},"caused_by_create_table":true}},{"CreateIndex":{"table":"_PersonsOnSale","index":{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"},"caused_by_create_table":true}},{"AddForeignKey":{"table":"_PersonsOnSale","foreign_key":{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"}}},{"AddForeignKey":{"table":"_PersonsOnSale","foreign_key":{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}}}]}


name: 20200820085242
status: MigrationSuccess
errors: []
datamodel:
datasource db {
  provider = "sqlite"
  url      = "***"
  default  = true
}

model Person {
  id        String  @id @default(cuid())
  name      String
  sales     Sale[]  @relation("PersonsOnSale", references: [id])
  canBeNull String?
}

model Sale {
  id        String   @id @default(cuid())
  date      DateTime
  persons   Person[] @relation("PersonsOnSale", references: [id])
  canBeNull String?
}

datamodel_steps:
[{"tag":"CreateField","model":"Person","field":"canBeNull","type":"String","arity":"Optional"},{"tag":"CreateField","model":"Sale","field":"canBeNull","type":"String","arity":"Optional"}]

database_migration:
{"before":{"tables":[{"name":"_Migration","columns":[{"name":"revision","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true},{"name":"name","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"status","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"applied","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"rolled_back","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel_steps","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"database_migration","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"errors","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"started_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"finished_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["revision"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"DATETIME","fullDataType":"DATETIME","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"},{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}],"enums":[],"sequences":[]},"after":{"tables":[{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"},{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}],"enums":[],"sequences":[]},"steps":[{"AlterTable":{"table":{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},"changes":[{"AddColumn":{"column":{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}}}]}},{"AlterTable":{"table":{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},"changes":[{"AddColumn":{"column":{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}}}]}}]}


name: 20200820090143
status: MigrationSuccess
errors: []
datamodel:
datasource db {
  provider = "sqlite"
  url      = "***"
  default  = true
}

model Person {
  id        String  @id @default(cuid())
  name      String
  sales     Sale[]  @relation("PersonsOnSale", references: [id])
  canBeNull String?
}

model Sale {
  id        String   @id @default(cuid())
  date      DateTime
  persons   Person[] @relation("PersonsOnSale", references: [id])
  canBeNull String?
}

model Location {
  id        Int     @id
  companyId Int
  company   Company @relation(fields: companyId, references: id)
}

model Company {
  id       Int      @id
  location Location
}

datamodel_steps:
[{"tag":"CreateModel","model":"Location"},{"tag":"CreateField","model":"Location","field":"id","type":"Int","arity":"Required"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Location","field":"id"},"directive":"id"}},{"tag":"CreateField","model":"Location","field":"companyId","type":"Int","arity":"Required"},{"tag":"CreateField","model":"Location","field":"company","type":"Company","arity":"Required"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Location","field":"company"},"directive":"relation"}},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Location","field":"company"},"directive":"relation"},"argument":"fields","value":"companyId"},{"tag":"CreateArgument","location":{"tag":"Directive","path":{"tag":"Field","model":"Location","field":"company"},"directive":"relation"},"argument":"references","value":"id"},{"tag":"CreateModel","model":"Company"},{"tag":"CreateField","model":"Company","field":"id","type":"Int","arity":"Required"},{"tag":"CreateDirective","location":{"path":{"tag":"Field","model":"Company","field":"id"},"directive":"id"}},{"tag":"CreateField","model":"Company","field":"location","type":"Location","arity":"Required"}]

database_migration:
{"before":{"tables":[{"name":"_Migration","columns":[{"name":"revision","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true},{"name":"name","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"status","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"applied","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"rolled_back","tpe":{"dataType":"INTEGER","fullDataType":"INTEGER","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false},{"name":"datamodel_steps","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"database_migration","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"errors","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"started_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"finished_at","tpe":{"dataType":"DATE","fullDataType":"DATE","characterMaximumLength":null,"family":"dateTime","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["revision"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"DATETIME","fullDataType":"DATETIME","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"TEXT","fullDataType":"TEXT","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"},{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}],"enums":[],"sequences":[]},"after":{"tables":[{"name":"Person","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"name","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Sale","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"date","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"dateTime","arity":"required"},"default":null,"autoIncrement":false},{"name":"canBeNull","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"nullable"},"default":null,"autoIncrement":false}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"Location","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true},{"name":"companyId","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"Location_companyId_unique","columns":["companyId"],"tpe":"unique"}],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[{"constraintName":null,"columns":["companyId"],"referencedTable":"Company","referencedColumns":["id"],"onDeleteAction":"cascade"}]},{"name":"Company","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]},{"name":"_PersonsOnSale","columns":[{"name":"A","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false},{"name":"B","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"string","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"_PersonsOnSale_AB_unique","columns":["A","B"],"tpe":"unique"},{"name":"_PersonsOnSale_B_index","columns":["B"],"tpe":"normal"}],"primaryKey":null,"foreignKeys":[{"constraintName":null,"columns":["A"],"referencedTable":"Person","referencedColumns":["id"],"onDeleteAction":"cascade"},{"constraintName":null,"columns":["B"],"referencedTable":"Sale","referencedColumns":["id"],"onDeleteAction":"cascade"}]}],"enums":[],"sequences":[]},"steps":[{"CreateTable":{"table":{"name":"Location","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true},{"name":"companyId","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":false}],"indices":[{"name":"Location_companyId_unique","columns":["companyId"],"tpe":"unique"}],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[{"constraintName":null,"columns":["companyId"],"referencedTable":"Company","referencedColumns":["id"],"onDeleteAction":"cascade"}]}}},{"CreateTable":{"table":{"name":"Company","columns":[{"name":"id","tpe":{"dataType":"","fullDataType":"","characterMaximumLength":null,"family":"int","arity":"required"},"default":null,"autoIncrement":true}],"indices":[],"primaryKey":{"columns":["id"],"sequence":null,"constraintName":null},"foreignKeys":[]}}},{"CreateIndex":{"table":"Location","index":{"name":"Location_companyId_unique","columns":["companyId"],"tpe":"unique"},"caused_by_create_table":true}},{"AddForeignKey":{"table":"Location","foreign_key":{"constraintName":null,"columns":["companyId"],"referencedTable":"Company","referencedColumns":["id"],"onDeleteAction":"cascade"}}}]}


