Files
kan/packages/db/migrations/meta/0000_snapshot.json
2024-12-12 14:34:10 +00:00

1180 lines
29 KiB
JSON

{
"version": "5",
"dialect": "pg",
"id": "32295e0d-123f-4eae-b323-1fe55e3c4dca",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"account": {
"name": "account",
"schema": "",
"columns": {
"userId": {
"name": "userId",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"providerAccountId": {
"name": "providerAccountId",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"expires_at": {
"name": "expires_at",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"token_type": {
"name": "token_type",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"scope": {
"name": "scope",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"session_state": {
"name": "session_state",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"account_userId_user_id_fk": {
"name": "account_userId_user_id_fk",
"tableFrom": "account",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"account_provider_providerAccountId": {
"name": "account_provider_providerAccountId",
"columns": [
"provider",
"providerAccountId"
]
}
},
"uniqueConstraints": {}
},
"board": {
"name": "board",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedAt": {
"name": "deletedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"deletedBy": {
"name": "deletedBy",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"importId": {
"name": "importId",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"workspaceId": {
"name": "workspaceId",
"type": "bigint",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"board_createdBy_user_id_fk": {
"name": "board_createdBy_user_id_fk",
"tableFrom": "board",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"board_deletedBy_user_id_fk": {
"name": "board_deletedBy_user_id_fk",
"tableFrom": "board",
"tableTo": "user",
"columnsFrom": [
"deletedBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"board_importId_import_id_fk": {
"name": "board_importId_import_id_fk",
"tableFrom": "board",
"tableTo": "import",
"columnsFrom": [
"importId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"board_workspaceId_workspace_id_fk": {
"name": "board_workspaceId_workspace_id_fk",
"tableFrom": "board",
"tableTo": "workspace",
"columnsFrom": [
"workspaceId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"board_publicId_unique": {
"name": "board_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"_card_workspace_members": {
"name": "_card_workspace_members",
"schema": "",
"columns": {
"cardId": {
"name": "cardId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"workspaceMemberId": {
"name": "workspaceMemberId",
"type": "bigint",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"_card_workspace_members_cardId_card_id_fk": {
"name": "_card_workspace_members_cardId_card_id_fk",
"tableFrom": "_card_workspace_members",
"tableTo": "card",
"columnsFrom": [
"cardId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"_card_workspace_members_workspaceMemberId_workspace_members_id_fk": {
"name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk",
"tableFrom": "_card_workspace_members",
"tableTo": "workspace_members",
"columnsFrom": [
"workspaceMemberId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"_card_workspace_members_cardId_workspaceMemberId": {
"name": "_card_workspace_members_cardId_workspaceMemberId",
"columns": [
"cardId",
"workspaceMemberId"
]
}
},
"uniqueConstraints": {}
},
"card": {
"name": "card",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"index": {
"name": "index",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedAt": {
"name": "deletedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedBy": {
"name": "deletedBy",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"listId": {
"name": "listId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"importId": {
"name": "importId",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"card_createdBy_user_id_fk": {
"name": "card_createdBy_user_id_fk",
"tableFrom": "card",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"card_deletedBy_user_id_fk": {
"name": "card_deletedBy_user_id_fk",
"tableFrom": "card",
"tableTo": "user",
"columnsFrom": [
"deletedBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"card_listId_list_id_fk": {
"name": "card_listId_list_id_fk",
"tableFrom": "card",
"tableTo": "list",
"columnsFrom": [
"listId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"card_importId_import_id_fk": {
"name": "card_importId_import_id_fk",
"tableFrom": "card",
"tableTo": "import",
"columnsFrom": [
"importId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"card_publicId_unique": {
"name": "card_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"_card_labels": {
"name": "_card_labels",
"schema": "",
"columns": {
"cardId": {
"name": "cardId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"labelId": {
"name": "labelId",
"type": "bigint",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"_card_labels_cardId_card_id_fk": {
"name": "_card_labels_cardId_card_id_fk",
"tableFrom": "_card_labels",
"tableTo": "card",
"columnsFrom": [
"cardId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"_card_labels_labelId_label_id_fk": {
"name": "_card_labels_labelId_label_id_fk",
"tableFrom": "_card_labels",
"tableTo": "label",
"columnsFrom": [
"labelId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"_card_labels_cardId_labelId": {
"name": "_card_labels_cardId_labelId",
"columns": [
"cardId",
"labelId"
]
}
},
"uniqueConstraints": {}
},
"import": {
"name": "import",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"source": {
"name": "source",
"type": "source",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "status",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"import_createdBy_user_id_fk": {
"name": "import_createdBy_user_id_fk",
"tableFrom": "import",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"import_publicId_unique": {
"name": "import_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"label": {
"name": "label",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"colourCode": {
"name": "colourCode",
"type": "varchar(12)",
"primaryKey": false,
"notNull": false
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"boardId": {
"name": "boardId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"importId": {
"name": "importId",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"label_createdBy_user_id_fk": {
"name": "label_createdBy_user_id_fk",
"tableFrom": "label",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"label_boardId_board_id_fk": {
"name": "label_boardId_board_id_fk",
"tableFrom": "label",
"tableTo": "board",
"columnsFrom": [
"boardId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"label_importId_import_id_fk": {
"name": "label_importId_import_id_fk",
"tableFrom": "label",
"tableTo": "import",
"columnsFrom": [
"importId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"label_publicId_unique": {
"name": "label_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"list": {
"name": "list",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"index": {
"name": "index",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedAt": {
"name": "deletedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedBy": {
"name": "deletedBy",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"boardId": {
"name": "boardId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"importId": {
"name": "importId",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"list_createdBy_user_id_fk": {
"name": "list_createdBy_user_id_fk",
"tableFrom": "list",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"list_deletedBy_user_id_fk": {
"name": "list_deletedBy_user_id_fk",
"tableFrom": "list",
"tableTo": "user",
"columnsFrom": [
"deletedBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"list_boardId_board_id_fk": {
"name": "list_boardId_board_id_fk",
"tableFrom": "list",
"tableTo": "board",
"columnsFrom": [
"boardId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"list_importId_import_id_fk": {
"name": "list_importId_import_id_fk",
"tableFrom": "list",
"tableTo": "import",
"columnsFrom": [
"importId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"list_publicId_unique": {
"name": "list_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"session": {
"name": "session",
"schema": "",
"columns": {
"sessionToken": {
"name": "sessionToken",
"type": "varchar(255)",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"expires": {
"name": "expires",
"type": "timestamp",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"session_userId_user_id_fk": {
"name": "session_userId_user_id_fk",
"tableFrom": "session",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"user": {
"name": "user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"emailVerified": {
"name": "emailVerified",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"image": {
"name": "image",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_email_unique": {
"name": "user_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
}
},
"verificationToken": {
"name": "verificationToken",
"schema": "",
"columns": {
"identifier": {
"name": "identifier",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"token": {
"name": "token",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"expires": {
"name": "expires",
"type": "timestamp",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"verificationToken_identifier_token": {
"name": "verificationToken_identifier_token",
"columns": [
"identifier",
"token"
]
}
},
"uniqueConstraints": {}
},
"workspace_members": {
"name": "workspace_members",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"userId": {
"name": "userId",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"workspaceId": {
"name": "workspaceId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedAt": {
"name": "deletedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "role",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"workspace_members_userId_user_id_fk": {
"name": "workspace_members_userId_user_id_fk",
"tableFrom": "workspace_members",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"workspace_members_workspaceId_workspace_id_fk": {
"name": "workspace_members_workspaceId_workspace_id_fk",
"tableFrom": "workspace_members",
"tableTo": "workspace",
"columnsFrom": [
"workspaceId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"workspace_members_publicId_unique": {
"name": "workspace_members_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
}
}
},
"workspace": {
"name": "workspace",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"publicId": {
"name": "publicId",
"type": "varchar(12)",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"slug": {
"name": "slug",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedAt": {
"name": "deletedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"deletedBy": {
"name": "deletedBy",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"workspace_createdBy_user_id_fk": {
"name": "workspace_createdBy_user_id_fk",
"tableFrom": "workspace",
"tableTo": "user",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"workspace_deletedBy_user_id_fk": {
"name": "workspace_deletedBy_user_id_fk",
"tableFrom": "workspace",
"tableTo": "user",
"columnsFrom": [
"deletedBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"workspace_publicId_unique": {
"name": "workspace_publicId_unique",
"nullsNotDistinct": false,
"columns": [
"publicId"
]
},
"workspace_slug_unique": {
"name": "workspace_slug_unique",
"nullsNotDistinct": false,
"columns": [
"slug"
]
}
}
}
},
"enums": {
"source": {
"name": "source",
"values": {
"trello": "trello"
}
},
"status": {
"name": "status",
"values": {
"started": "started",
"success": "success",
"failed": "failed"
}
},
"role": {
"name": "role",
"values": {
"admin": "admin",
"member": "member",
"guest": "guest"
}
}
},
"schemas": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}