mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 15:45:23 +00:00
feat: move termix identity into a plugin (C6)
This commit is contained in:
1 parent
6e56c90aac
commit
4dbce08379
157 files changed
+20743
-5766
No files matched your search
@@ -0,0 +1,46 @@
|
||||
-- termix-identity 0001: adopt_termix_identity_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
-- Hand-edited: keeps the legacy foreign keys the SDK cannot declare
|
||||
-- (keys and ca to their identity, keys to ssh_credentials).
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `termix_identities` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` varchar(255) NOT NULL UNIQUE,
|
||||
`handle` varchar(255) NOT NULL UNIQUE,
|
||||
`description` text,
|
||||
`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 `termix_identities` TO `p_termix_identity_identities`;
|
||||
CREATE TABLE IF NOT EXISTS `termix_identity_keys` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`identity_id` int NOT NULL,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`public_key` text NOT NULL,
|
||||
`key_type` text NOT NULL,
|
||||
`algorithm` text NOT NULL,
|
||||
`label` text,
|
||||
`comment` text,
|
||||
`source` text NOT NULL DEFAULT ('manual'),
|
||||
`credential_id` int,
|
||||
`enabled` boolean NOT NULL DEFAULT true,
|
||||
`created_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`identity_id`) REFERENCES `p_termix_identity_identities` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials` (`id`) ON DELETE SET NULL
|
||||
);
|
||||
RENAME TABLE `termix_identity_keys` TO `p_termix_identity_keys`;
|
||||
CREATE TABLE IF NOT EXISTS `termix_identity_ca` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`identity_id` int NOT NULL UNIQUE,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`public_key` text NOT NULL,
|
||||
`private_key` text NOT NULL,
|
||||
`validity_days` int NOT NULL DEFAULT 90,
|
||||
`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,
|
||||
FOREIGN KEY (`identity_id`) REFERENCES `p_termix_identity_identities` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `termix_identity_ca` TO `p_termix_identity_ca`;
|
||||
Reference in new issue
Block a user