mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
38 lines
1.2 KiB
SQL
38 lines
1.2 KiB
SQL
-- vault 0001: adopt_vault_tables
|
|
-- Generated by termix-plugin migrations. Review before committing.
|
|
|
|
CREATE TABLE IF NOT EXISTS `vault_profiles` (
|
|
`id` int AUTO_INCREMENT PRIMARY KEY,
|
|
`user_id` varchar(255) NOT NULL,
|
|
`name` text NOT NULL,
|
|
`description` text,
|
|
`folder` text,
|
|
`tags` text,
|
|
`vault_addr` text NOT NULL,
|
|
`vault_namespace` text,
|
|
`oidc_mount` text,
|
|
`oidc_role` text,
|
|
`ssh_mount` text,
|
|
`ssh_role` text NOT NULL,
|
|
`valid_principals` text,
|
|
`key_type` text,
|
|
`shared` boolean NOT NULL DEFAULT false,
|
|
`sync_id` varchar(255) UNIQUE,
|
|
`created_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
|
`updated_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
);
|
|
RENAME TABLE `vault_profiles` TO `p_vault_profiles`;
|
|
CREATE TABLE IF NOT EXISTS `vault_tokens` (
|
|
`id` int AUTO_INCREMENT PRIMARY KEY,
|
|
`user_id` varchar(255) NOT NULL,
|
|
`profile_id` int NOT NULL,
|
|
`ssh_cert` text NOT NULL,
|
|
`private_key` text NOT NULL,
|
|
`created_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
|
`expires_at` varchar(255) NOT NULL,
|
|
`last_used` text,
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
);
|
|
RENAME TABLE `vault_tokens` TO `p_vault_tokens`;
|