16 lines
811 B
SQL
16 lines
811 B
SQL
CREATE TABLE `project_secrets` (
|
|
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
`project_id` integer NOT NULL,
|
|
`name` text NOT NULL,
|
|
`value_enc` text NOT NULL,
|
|
`created_by` integer,
|
|
`updated_by` integer,
|
|
`created_at` integer DEFAULT (cast(unixepoch('subsec') * 1000 as integer)) NOT NULL,
|
|
`updated_at` integer DEFAULT (cast(unixepoch('subsec') * 1000 as integer)) NOT NULL,
|
|
`last_used_at` integer,
|
|
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
|
|
FOREIGN KEY (`updated_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `project_secrets_project_name` ON `project_secrets` (`project_id`,`name`); |