|
| 1 | +CREATE TABLE `access_key` ( |
| 2 | + `id` text PRIMARY KEY NOT NULL, |
| 3 | + `account_id` text NOT NULL, |
| 4 | + `name` text NOT NULL, |
| 5 | + `friendly_name` text NOT NULL, |
| 6 | + `description` text, |
| 7 | + `created_by` text NOT NULL, |
| 8 | + `created_time` integer NOT NULL, |
| 9 | + `expires` integer NOT NULL, |
| 10 | + `is_session` integer, |
| 11 | + FOREIGN KEY (`account_id`) REFERENCES `account`(`id`) ON UPDATE no action ON DELETE no action |
| 12 | +); |
| 13 | +--> statement-breakpoint |
| 14 | +CREATE UNIQUE INDEX `access_key_name_unique` ON `access_key` (`name`);--> statement-breakpoint |
| 15 | +CREATE TABLE `account` ( |
| 16 | + `id` text PRIMARY KEY NOT NULL, |
| 17 | + `email` text NOT NULL, |
| 18 | + `name` text NOT NULL, |
| 19 | + `github_id` text, |
| 20 | + `created_time` integer NOT NULL |
| 21 | +); |
| 22 | +--> statement-breakpoint |
| 23 | +CREATE UNIQUE INDEX `account_email_unique` ON `account` (`email`);--> statement-breakpoint |
| 24 | +CREATE TABLE `app` ( |
| 25 | + `id` text PRIMARY KEY NOT NULL, |
| 26 | + `name` text NOT NULL, |
| 27 | + `created_time` integer NOT NULL |
| 28 | +); |
| 29 | +--> statement-breakpoint |
| 30 | +CREATE TABLE `collaborator` ( |
| 31 | + `app_id` text NOT NULL, |
| 32 | + `account_id` text NOT NULL, |
| 33 | + `permission` text NOT NULL, |
| 34 | + PRIMARY KEY(`app_id`, `account_id`), |
| 35 | + FOREIGN KEY (`app_id`) REFERENCES `app`(`id`) ON UPDATE no action ON DELETE no action, |
| 36 | + FOREIGN KEY (`account_id`) REFERENCES `account`(`id`) ON UPDATE no action ON DELETE no action |
| 37 | +); |
| 38 | +--> statement-breakpoint |
| 39 | +CREATE TABLE `deployment` ( |
| 40 | + `id` text PRIMARY KEY NOT NULL, |
| 41 | + `app_id` text NOT NULL, |
| 42 | + `name` text NOT NULL, |
| 43 | + `key` text NOT NULL, |
| 44 | + `created_time` integer NOT NULL, |
| 45 | + FOREIGN KEY (`app_id`) REFERENCES `app`(`id`) ON UPDATE no action ON DELETE no action |
| 46 | +); |
| 47 | +--> statement-breakpoint |
| 48 | +CREATE UNIQUE INDEX `deployment_key_unique` ON `deployment` (`key`);--> statement-breakpoint |
| 49 | +CREATE TABLE `package_diff` ( |
| 50 | + `id` text PRIMARY KEY NOT NULL, |
| 51 | + `package_id` text NOT NULL, |
| 52 | + `source_package_hash` text NOT NULL, |
| 53 | + `size` integer NOT NULL, |
| 54 | + `blob_path` text NOT NULL, |
| 55 | + FOREIGN KEY (`package_id`) REFERENCES `package`(`id`) ON UPDATE no action ON DELETE no action |
| 56 | +); |
| 57 | +--> statement-breakpoint |
| 58 | +CREATE UNIQUE INDEX `package_diff_package_id_source_package_hash_unique` ON `package_diff` (`package_id`,`source_package_hash`);--> statement-breakpoint |
| 59 | +CREATE TABLE `package` ( |
| 60 | + `id` text PRIMARY KEY NOT NULL, |
| 61 | + `deployment_id` text NOT NULL, |
| 62 | + `label` text NOT NULL, |
| 63 | + `app_version` text NOT NULL, |
| 64 | + `description` text, |
| 65 | + `is_disabled` integer NOT NULL, |
| 66 | + `is_mandatory` integer NOT NULL, |
| 67 | + `rollout` integer, |
| 68 | + `size` integer NOT NULL, |
| 69 | + `blob_path` text NOT NULL, |
| 70 | + `manifest_blob_path` text, |
| 71 | + `package_hash` text NOT NULL, |
| 72 | + `release_method` text, |
| 73 | + `original_label` text, |
| 74 | + `original_deployment` text, |
| 75 | + `released_by` text, |
| 76 | + `upload_time` integer NOT NULL, |
| 77 | + FOREIGN KEY (`deployment_id`) REFERENCES `deployment`(`id`) ON UPDATE no action ON DELETE no action |
| 78 | +); |
0 commit comments