-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
315 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
CREATE TABLE `__new_projects` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`team_id` text NOT NULL, | ||
`name` text NOT NULL, | ||
`description` text, | ||
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
FOREIGN KEY (`team_id`) REFERENCES `teams`(`id`) ON UPDATE no action ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_projects`("id", "team_id", "name", "description", "created_at", "updated_at") SELECT "id", "team_id", "name", "description", "created_at", "updated_at" FROM `projects`;--> statement-breakpoint | ||
DROP TABLE `projects`;--> statement-breakpoint | ||
ALTER TABLE `__new_projects` RENAME TO `projects`;--> statement-breakpoint | ||
PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
CREATE TABLE `__new_team_members` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`team_id` text NOT NULL, | ||
`user_id` text NOT NULL, | ||
`role` text NOT NULL, | ||
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
FOREIGN KEY (`team_id`) REFERENCES `teams`(`id`) ON UPDATE no action ON DELETE cascade, | ||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_team_members`("id", "team_id", "user_id", "role", "created_at", "updated_at") SELECT "id", "team_id", "user_id", "role", "created_at", "updated_at" FROM `team_members`;--> statement-breakpoint | ||
DROP TABLE `team_members`;--> statement-breakpoint | ||
ALTER TABLE `__new_team_members` RENAME TO `team_members`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,276 @@ | ||
{ | ||
"version": "6", | ||
"dialect": "sqlite", | ||
"id": "c1e50742-3003-4e1c-82e0-237e3e6c2876", | ||
"prevId": "358d4d4a-8540-4b87-b0d4-478cbea7c2fc", | ||
"tables": { | ||
"projects": { | ||
"name": "projects", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"team_id": { | ||
"name": "team_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"description": { | ||
"name": "description", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"projects_team_id_teams_id_fk": { | ||
"name": "projects_team_id_teams_id_fk", | ||
"tableFrom": "projects", | ||
"tableTo": "teams", | ||
"columnsFrom": [ | ||
"team_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "cascade", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
}, | ||
"team_members": { | ||
"name": "team_members", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"team_id": { | ||
"name": "team_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"role": { | ||
"name": "role", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"team_members_team_id_teams_id_fk": { | ||
"name": "team_members_team_id_teams_id_fk", | ||
"tableFrom": "team_members", | ||
"tableTo": "teams", | ||
"columnsFrom": [ | ||
"team_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "cascade", | ||
"onUpdate": "no action" | ||
}, | ||
"team_members_user_id_users_id_fk": { | ||
"name": "team_members_user_id_users_id_fk", | ||
"tableFrom": "team_members", | ||
"tableTo": "users", | ||
"columnsFrom": [ | ||
"user_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
}, | ||
"teams": { | ||
"name": "teams", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
}, | ||
"users": { | ||
"name": "users", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"email": { | ||
"name": "email", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"avatar": { | ||
"name": "avatar", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"provider": { | ||
"name": "provider", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": { | ||
"users_email_unique": { | ||
"name": "users_email_unique", | ||
"columns": [ | ||
"email" | ||
], | ||
"isUnique": true | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
} | ||
}, | ||
"views": {}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
}, | ||
"internal": { | ||
"indexes": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters