diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml
index 27b1a4fbb..a2c125e1b 100644
--- a/.github/workflows/electron.yml
+++ b/.github/workflows/electron.yml
@@ -427,6 +427,7 @@ jobs:
npm ci
npm install --force @rollup/rollup-darwin-arm64
npm install dmg-license
+ node scripts/install-macos-sharp.cjs
- name: Check for Code Signing Certificates
id: check_certs
@@ -538,6 +539,14 @@ jobs:
fi
npx electron-builder --mac dmg --universal --x64 --arm64 --publish never
+ - name: Verify macOS sharp packaging
+ run: |
+ artifacts=(release/termix_macos_*_dmg.dmg)
+ if [ -f release/termix_macos_universal_mas.pkg ]; then
+ artifacts+=(release/termix_macos_universal_mas.pkg)
+ fi
+ node scripts/verify-macos-sharp.cjs "${artifacts[@]}"
+
- name: Upload macOS MAS PKG
if: steps.check_certs.outputs.has_certs == 'true' && hashFiles('release/termix_macos_universal_mas.pkg') != '' && (inputs.artifact_destination == 'file' || inputs.artifact_destination == 'release' || inputs.artifact_destination == 'submit')
uses: actions/upload-artifact@v7
@@ -923,6 +932,9 @@ jobs:
echo "dmg_name=$DMG_NAME" >> $GITHUB_OUTPUT
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
+ - name: Verify macOS sharp packaging
+ run: node scripts/verify-macos-sharp.cjs release_asset/termix_macos_universal_dmg.dmg
+
- name: Prepare Homebrew submission files
run: |
VERSION="${{ steps.package-version.outputs.version }}"
@@ -1013,6 +1025,7 @@ jobs:
npm ci
npm install --force @rollup/rollup-darwin-arm64
npm install dmg-license
+ node scripts/install-macos-sharp.cjs
- name: Check for Code Signing Certificates
id: check_certs
@@ -1154,6 +1167,10 @@ jobs:
BUILD_VERSION="${{ steps.build_number.outputs.build_version || github.run_number }}"
npm run build && npx electron-builder --mac mas --universal --config.buildVersion="$BUILD_VERSION"
+ - name: Verify macOS sharp packaging
+ if: steps.check_certs.outputs.has_certs == 'true'
+ run: node scripts/verify-macos-sharp.cjs release/termix_macos_universal_mas.pkg
+
- name: Generate App Store release notes
id: asc_notes
if: steps.check_certs.outputs.has_certs == 'true' && steps.check_asc_creds.outputs.has_credentials == 'true'
diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml
index a7de80140..4f8e3c66e 100644
--- a/.github/workflows/helm.yml
+++ b/.github/workflows/helm.yml
@@ -5,13 +5,11 @@ on:
paths:
- "charts/**"
- ".github/workflows/helm.yml"
- - "deploy/**"
push:
branches: [main]
paths:
- "charts/**"
- ".github/workflows/helm.yml"
- - "deploy/**"
workflow_dispatch:
inputs:
publish:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 2d7e77461..000000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-include:
- - local: deploy/gitlab/.gitlab-ci.yml
diff --git a/README.md b/README.md
index 8c7c18b2e..e78828f85 100644
--- a/README.md
+++ b/README.md
@@ -89,7 +89,7 @@ Local, remote, and dynamic SOCKS forwarding with auto reconnect and health check
-|
-
-**Ứng dụng máy tính độc lập và đồng bộ:**
-Ứng dụng máy tính chạy độc lập với backend và cơ sở dữ liệu riêng, không cần máy chủ. Bạn cũng có thể nối nó với một máy chủ Termix để đồng bộ hai chiều máy chủ, thông tin đăng nhập, đoạn lệnh và nhiều thứ khác, và chọn kết nối xuất phát từ máy của bạn hay đi qua máy chủ.
-
- |
-
-
**Dòng lệnh:**
Công cụ `termix` cho shell và các script của bạn. Mở terminal, chạy một lệnh trên một máy chủ hoặc cả một nhóm, chuyển tệp qua SFTP, và quản lý máy chủ, đoạn lệnh và thông tin đăng nhập. Cài bằng `npm install -g @termix-cli/cli` hoặc tải bản chạy độc lập. Xem [tài liệu CLI](https://docs.termix.site/cli).
@@ -237,7 +223,7 @@ Công cụ `termix` cho shell và các script của bạn. Mở terminal, chạy
|
**Bảo mật:**
-Mật khẩu, khoá và các thông tin bí mật khác được mã hoá theo từng người dùng, và bản thân các tệp cơ sở dữ liệu cũng có thể mã hoá trên ổ đĩa. Xem [tài liệu](https://docs.termix.site/security) để biết cách hoạt động.
+Mật khẩu, khoá và các thông tin bí mật khác được mã hoá theo từng người dùng, và bản thân các tệp cơ sở dữ liệu cũng có thể mã hoá trên ổ đĩa. Xem [tài liệu](https://docs.termix.site/features/authentication/security/) để biết cách hoạt động.
|
@@ -267,8 +253,13 @@ Có sẵn khoảng 30 ngôn ngữ, quản lý qua [Crowdin](https://docs.termix.
- **Phím tắt** - Chuyển giữa các thẻ, đóng thẻ và nhiều thao tác khác, đều gán lại được
- **Wake-on-LAN** - Đánh thức một máy từ Termix hoặc từ một bước tự động hoá
- **Xác thực qua proxy tin cậy** - Để reverse proxy lo phần đăng nhập rồi chuyển thông tin người dùng vào
-- **SSH nhiều tính năng** - Máy chủ trung gian, Warpgate, hỏi mã TOTP, SOCKS5, kiểm tra khoá máy chủ, tự điền mật khẩu, [OPKSSH](https://github.com/openpubkey/opkssh), tmux, port knocking, ghi nhật ký terminal, chuyển tiếp agent, SSH agent của Bitwarden, ký SSH bằng HashiCorp Vault và nhiều thứ khác
+- **Nhãn trắng** - Quản trị viên có thể đổi thương hiệu hệ thống với tên, logo và màu sắc riêng
+- **Điểm cuối web** - Mở giao diện web riêng của một máy chủ, chẳng hạn trang quản trị router, ngay trong Termix thay vì mở một thẻ riêng
+- **Phòng cộng tác** - Phòng lâu dài để cả nhóm cùng chuyển qua lại giữa các phiên, có sân khấu người trình bày và lời mời
+- **SSH nhiều tính năng** - Máy chủ trung gian, Warpgate, hỏi mã TOTP, SOCKS5, kiểm tra khoá máy chủ, tự điền mật khẩu, [OPKSSH](https://github.com/openpubkey/opkssh), tmux, port knocking, ghi nhật ký terminal, chuyển tiếp agent, SSH agent của Bitwarden, ký SSH bằng HashiCorp Vault, Step CA, 1Password Connect và nhiều thứ khác
- **Termix ID** - Bản dựng sẵn theo kiểu sshid.io. Đăng ký một tên, công bố khoá công khai của bạn tại một địa chỉ phân giải, và cấp chứng chỉ SSH từ CA tích hợp
+- **Gợi ý lịch sử lệnh** - Gợi ý ngay trong terminal khi bạn gõ, dựa trên lịch sử lệnh của bạn
+- **Ứng dụng máy tính độc lập và đồng bộ** - Ứng dụng máy tính chạy độc lập với backend và cơ sở dữ liệu riêng, có thể đồng bộ tuỳ chọn với một máy chủ Termix
diff --git a/drizzle/mysql/0015_red_cobalt_man.sql b/drizzle/mysql/0015_red_cobalt_man.sql
new file mode 100644
index 000000000..b396edfaf
--- /dev/null
+++ b/drizzle/mysql/0015_red_cobalt_man.sql
@@ -0,0 +1,34 @@
+CREATE TABLE `collab_room_members` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `room_id` varchar(255) NOT NULL,
+ `user_id` varchar(255) NOT NULL,
+ `room_role` text NOT NULL DEFAULT ('member'),
+ `added_by` varchar(255),
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `collab_room_members_id` PRIMARY KEY(`id`),
+ CONSTRAINT `idx_collab_room_members_room_user` UNIQUE(`room_id`,`user_id`)
+);
+--> statement-breakpoint
+CREATE TABLE `collab_rooms` (
+ `id` varchar(255) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `owner_user_id` varchar(255) NOT NULL,
+ `persistent` boolean NOT NULL DEFAULT false,
+ `presenter_user_id` varchar(255),
+ `stage_protocol` text,
+ `stage_host_id` int,
+ `stage_share_id` varchar(255),
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `ended_at` text,
+ CONSTRAINT `collab_rooms_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+ALTER TABLE `collab_room_members` ADD CONSTRAINT `collab_room_members_room_id_collab_rooms_id_fk` FOREIGN KEY (`room_id`) REFERENCES `collab_rooms`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_room_members` ADD CONSTRAINT `collab_room_members_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_room_members` ADD CONSTRAINT `collab_room_members_added_by_users_id_fk` FOREIGN KEY (`added_by`) REFERENCES `users`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_rooms` ADD CONSTRAINT `collab_rooms_owner_user_id_users_id_fk` FOREIGN KEY (`owner_user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_rooms` ADD CONSTRAINT `collab_rooms_presenter_user_id_users_id_fk` FOREIGN KEY (`presenter_user_id`) REFERENCES `users`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_rooms` ADD CONSTRAINT `collab_rooms_stage_host_id_ssh_data_id_fk` FOREIGN KEY (`stage_host_id`) REFERENCES `ssh_data`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `collab_rooms` ADD CONSTRAINT `collab_rooms_stage_share_id_session_shares_id_fk` FOREIGN KEY (`stage_share_id`) REFERENCES `session_shares`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX `idx_collab_room_members_user` ON `collab_room_members` (`user_id`);--> statement-breakpoint
+CREATE INDEX `idx_collab_rooms_owner` ON `collab_rooms` (`owner_user_id`);
\ No newline at end of file
diff --git a/drizzle/mysql/0016_unusual_tyrannus.sql b/drizzle/mysql/0016_unusual_tyrannus.sql
new file mode 100644
index 000000000..5567416c1
--- /dev/null
+++ b/drizzle/mysql/0016_unusual_tyrannus.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `collab_rooms` ADD `guest_link_token` varchar(255);--> statement-breakpoint
+ALTER TABLE `collab_rooms` ADD CONSTRAINT `idx_collab_rooms_guest_token` UNIQUE(`guest_link_token`);
\ No newline at end of file
diff --git a/drizzle/mysql/0017_spicy_proteus.sql b/drizzle/mysql/0017_spicy_proteus.sql
new file mode 100644
index 000000000..f75056c60
--- /dev/null
+++ b/drizzle/mysql/0017_spicy_proteus.sql
@@ -0,0 +1,15 @@
+CREATE TABLE `secret_sources` (
+ `id` varchar(255) NOT NULL,
+ `user_id` varchar(255) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `kind` text NOT NULL DEFAULT ('onepassword-connect'),
+ `base_url` text NOT NULL,
+ `token` text NOT NULL,
+ `shared` boolean NOT NULL DEFAULT false,
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `updated_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `secret_sources_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+ALTER TABLE `secret_sources` ADD CONSTRAINT `secret_sources_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX `idx_secret_sources_user` ON `secret_sources` (`user_id`);
\ No newline at end of file
diff --git a/drizzle/mysql/0018_fancy_barracuda.sql b/drizzle/mysql/0018_fancy_barracuda.sql
new file mode 100644
index 000000000..7f53627c1
--- /dev/null
+++ b/drizzle/mysql/0018_fancy_barracuda.sql
@@ -0,0 +1,42 @@
+CREATE TABLE `credential_access` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `credential_id` int NOT NULL,
+ `user_id` varchar(255),
+ `role_id` int,
+ `granted_by` varchar(255) NOT NULL,
+ `permission_level` text NOT NULL DEFAULT ('use'),
+ `expires_at` varchar(255),
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `credential_access_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+CREATE TABLE `shared_credential_secrets` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `credential_access_id` int NOT NULL,
+ `target_user_id` varchar(255) NOT NULL,
+ `credential_id` int NOT NULL,
+ `encrypted_username` text,
+ `auth_type` text NOT NULL DEFAULT ('password'),
+ `encrypted_password` text,
+ `encrypted_key` text,
+ `encrypted_key_password` text,
+ `key_type` text,
+ `public_key` text,
+ `cert_public_key` text,
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `updated_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `shared_credential_secrets_id` PRIMARY KEY(`id`),
+ CONSTRAINT `idx_shared_credential_secrets_scope` UNIQUE(`credential_access_id`,`target_user_id`)
+);
+--> statement-breakpoint
+ALTER TABLE `credential_access` ADD CONSTRAINT `credential_access_credential_id_ssh_credentials_id_fk` FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `credential_access` ADD CONSTRAINT `credential_access_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `credential_access` ADD CONSTRAINT `credential_access_role_id_roles_id_fk` FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `credential_access` ADD CONSTRAINT `credential_access_granted_by_users_id_fk` FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `shared_credential_secrets` ADD CONSTRAINT `shared_cred_secrets_access_id_fk` FOREIGN KEY (`credential_access_id`) REFERENCES `credential_access`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `shared_credential_secrets` ADD CONSTRAINT `shared_credential_secrets_target_user_id_users_id_fk` FOREIGN KEY (`target_user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `shared_credential_secrets` ADD CONSTRAINT `shared_credential_secrets_credential_id_ssh_credentials_id_fk` FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX `idx_credential_access_user_id` ON `credential_access` (`user_id`);--> statement-breakpoint
+CREATE INDEX `idx_credential_access_role_id` ON `credential_access` (`role_id`);--> statement-breakpoint
+CREATE INDEX `idx_credential_access_credential_id` ON `credential_access` (`credential_id`);--> statement-breakpoint
+CREATE INDEX `idx_shared_credential_secrets_target` ON `shared_credential_secrets` (`target_user_id`,`credential_id`);
diff --git a/drizzle/mysql/0019_certain_archangel.sql b/drizzle/mysql/0019_certain_archangel.sql
new file mode 100644
index 000000000..d795ee977
--- /dev/null
+++ b/drizzle/mysql/0019_certain_archangel.sql
@@ -0,0 +1,22 @@
+CREATE TABLE `folder_access` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `owner_user_id` varchar(255) NOT NULL,
+ `folder` varchar(255) NOT NULL,
+ `user_id` varchar(255),
+ `role_id` int,
+ `granted_by` varchar(255) NOT NULL,
+ `permission_level` text NOT NULL DEFAULT ('connect'),
+ `expires_at` varchar(255),
+ `created_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `folder_access_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+ALTER TABLE `ssh_data` MODIFY COLUMN `folder` varchar(255);--> statement-breakpoint
+ALTER TABLE `snippets` MODIFY COLUMN `folder` varchar(255);--> statement-breakpoint
+ALTER TABLE `ssh_credentials` MODIFY COLUMN `folder` varchar(255);--> statement-breakpoint
+ALTER TABLE `vault_profiles` MODIFY COLUMN `folder` varchar(255);--> statement-breakpoint
+ALTER TABLE `folder_access` ADD CONSTRAINT `folder_access_owner_user_id_users_id_fk` FOREIGN KEY (`owner_user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `folder_access` ADD CONSTRAINT `folder_access_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `folder_access` ADD CONSTRAINT `folder_access_role_id_roles_id_fk` FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `folder_access` ADD CONSTRAINT `folder_access_granted_by_users_id_fk` FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX `idx_folder_access_owner_folder` ON `folder_access` (`owner_user_id`,`folder`);
diff --git a/drizzle/mysql/0020_wise_green_goblin.sql b/drizzle/mysql/0020_wise_green_goblin.sql
new file mode 100644
index 000000000..dc7ec231f
--- /dev/null
+++ b/drizzle/mysql/0020_wise_green_goblin.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `ssh_data` ADD `enable_web_ui` boolean DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE `ssh_data` ADD `web_ui_config` text;
\ No newline at end of file
diff --git a/drizzle/mysql/0021_thick_galactus.sql b/drizzle/mysql/0021_thick_galactus.sql
new file mode 100644
index 000000000..f51479b9f
--- /dev/null
+++ b/drizzle/mysql/0021_thick_galactus.sql
@@ -0,0 +1 @@
+ALTER TABLE `ssh_data` ADD `enable_ai_assistant` boolean DEFAULT false NOT NULL;
\ No newline at end of file
diff --git a/drizzle/mysql/0022_secret_blacklash.sql b/drizzle/mysql/0022_secret_blacklash.sql
new file mode 100644
index 000000000..0f27aa229
--- /dev/null
+++ b/drizzle/mysql/0022_secret_blacklash.sql
@@ -0,0 +1,51 @@
+CREATE TABLE `plugin_install_counts` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `plugin_id` varchar(255) NOT NULL,
+ `registry_id` varchar(255) NOT NULL,
+ `count` int NOT NULL DEFAULT 0,
+ `source` text NOT NULL DEFAULT ('aggregate-telemetry'),
+ `updated_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ CONSTRAINT `plugin_install_counts_id` PRIMARY KEY(`id`),
+ CONSTRAINT `idx_plugin_install_counts_plugin_registry` UNIQUE(`plugin_id`,`registry_id`)
+);
+--> statement-breakpoint
+CREATE TABLE `plugin_permission_grants` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `plugin_id` varchar(255) NOT NULL,
+ `capability` varchar(255) NOT NULL,
+ `granted_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `granted_by` varchar(255) NOT NULL,
+ CONSTRAINT `plugin_permission_grants_id` PRIMARY KEY(`id`),
+ CONSTRAINT `idx_plugin_permission_grants_plugin_capability` UNIQUE(`plugin_id`,`capability`)
+);
+--> statement-breakpoint
+CREATE TABLE `plugin_registries` (
+ `id` varchar(255) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `url` text NOT NULL,
+ `kind` text NOT NULL DEFAULT ('community'),
+ `enabled` boolean NOT NULL DEFAULT true,
+ `signing_key` text,
+ `last_checked_at` text,
+ `last_index_hash` text,
+ CONSTRAINT `plugin_registries_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+CREATE TABLE `plugins` (
+ `id` varchar(255) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `version` text NOT NULL,
+ `tier` text NOT NULL DEFAULT ('available'),
+ `source` text NOT NULL DEFAULT ('community'),
+ `registry_id` varchar(255),
+ `state` text NOT NULL DEFAULT ('disabled'),
+ `installed_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `updated_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
+ `auto_update` boolean NOT NULL DEFAULT false,
+ `manifest_json` text NOT NULL,
+ CONSTRAINT `plugins_id` PRIMARY KEY(`id`)
+);
+--> statement-breakpoint
+ALTER TABLE `plugin_permission_grants` ADD CONSTRAINT `plugin_permission_grants_plugin_id_plugins_id_fk` FOREIGN KEY (`plugin_id`) REFERENCES `plugins`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE `plugin_permission_grants` ADD CONSTRAINT `plugin_permission_grants_granted_by_users_id_fk` FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX `idx_plugins_registry_id` ON `plugins` (`registry_id`);
\ No newline at end of file
diff --git a/drizzle/mysql/0023_even_beast.sql b/drizzle/mysql/0023_even_beast.sql
new file mode 100644
index 000000000..b5b769f93
--- /dev/null
+++ b/drizzle/mysql/0023_even_beast.sql
@@ -0,0 +1 @@
+ALTER TABLE `user_preferences` ADD `show_pin_app_rail_button` boolean;
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0015_snapshot.json b/drizzle/mysql/meta/0015_snapshot.json
new file mode 100644
index 000000000..b3d69c574
--- /dev/null
+++ b/drizzle/mysql/meta/0015_snapshot.json
@@ -0,0 +1,9046 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "df7a9e26-6a59-4dd6-82a9-476cdf9532da",
+ "prevId": "18a71d34-625b-452c-9035-b1b78df110f3",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0016_snapshot.json b/drizzle/mysql/meta/0016_snapshot.json
new file mode 100644
index 000000000..60e445a57
--- /dev/null
+++ b/drizzle/mysql/meta/0016_snapshot.json
@@ -0,0 +1,9060 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "15c693d8-04ea-43fa-afb6-c6fedacb66d0",
+ "prevId": "df7a9e26-6a59-4dd6-82a9-476cdf9532da",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0017_snapshot.json b/drizzle/mysql/meta/0017_snapshot.json
new file mode 100644
index 000000000..5397478c4
--- /dev/null
+++ b/drizzle/mysql/meta/0017_snapshot.json
@@ -0,0 +1,9166 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "78aa5a29-227b-488d-af52-a356b09ba9da",
+ "prevId": "15c693d8-04ea-43fa-afb6-c6fedacb66d0",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0018_snapshot.json b/drizzle/mysql/meta/0018_snapshot.json
new file mode 100644
index 000000000..8f024c19d
--- /dev/null
+++ b/drizzle/mysql/meta/0018_snapshot.json
@@ -0,0 +1,9491 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "03a24087-558c-44b2-a473-246ae474b218",
+ "prevId": "78aa5a29-227b-488d-af52-a356b09ba9da",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
diff --git a/drizzle/mysql/meta/0019_snapshot.json b/drizzle/mysql/meta/0019_snapshot.json
new file mode 100644
index 000000000..67c4769b3
--- /dev/null
+++ b/drizzle/mysql/meta/0019_snapshot.json
@@ -0,0 +1,9635 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "e39cdc1e-1786-41eb-8e5e-af9cd39ba3c0",
+ "prevId": "03a24087-558c-44b2-a473-246ae474b218",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folder_access_id": {
+ "name": "folder_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
diff --git a/drizzle/mysql/meta/0020_snapshot.json b/drizzle/mysql/meta/0020_snapshot.json
new file mode 100644
index 000000000..1abf6dfe8
--- /dev/null
+++ b/drizzle/mysql/meta/0020_snapshot.json
@@ -0,0 +1,9650 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "f149ca74-7386-4ce5-812a-eb8d5c502fab",
+ "prevId": "e39cdc1e-1786-41eb-8e5e-af9cd39ba3c0",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folder_access_id": {
+ "name": "folder_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0021_snapshot.json b/drizzle/mysql/meta/0021_snapshot.json
new file mode 100644
index 000000000..e18fd42a7
--- /dev/null
+++ b/drizzle/mysql/meta/0021_snapshot.json
@@ -0,0 +1,9658 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "e33a32b2-f233-4429-a6cf-0070fd1d004c",
+ "prevId": "f149ca74-7386-4ce5-812a-eb8d5c502fab",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folder_access_id": {
+ "name": "folder_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0022_snapshot.json b/drizzle/mysql/meta/0022_snapshot.json
new file mode 100644
index 000000000..5536dc082
--- /dev/null
+++ b/drizzle/mysql/meta/0022_snapshot.json
@@ -0,0 +1,10001 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "e0cce826-6cdd-480b-a03b-6c1ac72d176e",
+ "prevId": "e33a32b2-f233-4429-a6cf-0070fd1d004c",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folder_access_id": {
+ "name": "folder_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "count": {
+ "name": "count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('aggregate-telemetry')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ "plugin_id",
+ "registry_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugin_install_counts_id": {
+ "name": "plugin_install_counts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "capability": {
+ "name": "capability",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ "plugin_id",
+ "capability"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "plugin_permission_grants_id": {
+ "name": "plugin_permission_grants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_registries": {
+ "name": "plugin_registries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('community')"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugin_registries_id": {
+ "name": "plugin_registries_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugins": {
+ "name": "plugins",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('available')"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('community')"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('disabled')"
+ },
+ "installed_at": {
+ "name": "installed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ "registry_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugins_id": {
+ "name": "plugins_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/0023_snapshot.json b/drizzle/mysql/meta/0023_snapshot.json
new file mode 100644
index 000000000..3abb4c5cb
--- /dev/null
+++ b/drizzle/mysql/meta/0023_snapshot.json
@@ -0,0 +1,10008 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "56f0bd51-389d-4e3c-adc1-d9184927267f",
+ "prevId": "e0cce826-6cdd-480b-a03b-6c1ac72d176e",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_conversations_id": {
+ "name": "ai_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_messages_id": {
+ "name": "ai_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_proposals_id": {
+ "name": "ai_proposals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ai_providers_id": {
+ "name": "ai_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('warning')"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_firings_id": {
+ "name": "alert_firings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rule_channels_id": {
+ "name": "alert_rule_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "alert_rules_id": {
+ "name": "alert_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_channels_id": {
+ "name": "automation_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_run_steps_id": {
+ "name": "automation_run_steps_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_runs_id": {
+ "name": "automation_runs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_schedules_id": {
+ "name": "automation_schedules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automation_trigger_state_id": {
+ "name": "automation_trigger_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('skip')"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "automations_id": {
+ "name": "automations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "c2s_tunnel_presets_id": {
+ "name": "c2s_tunnel_presets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('member')"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_room_members_id": {
+ "name": "collab_room_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "collab_rooms_id": {
+ "name": "collab_rooms_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "command_history_id": {
+ "name": "command_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('use')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "credential_sidebar_preferences_user_id": {
+ "name": "credential_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dashboard_service_links_id": {
+ "name": "dashboard_service_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "dismissed_alerts_id": {
+ "name": "dismissed_alerts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_pinned_id": {
+ "name": "file_manager_pinned_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_recent_id": {
+ "name": "file_manager_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "file_manager_shortcuts_id": {
+ "name": "file_manager_shortcuts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_inventory_id": {
+ "name": "fleet_inventory_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleet_members_id": {
+ "name": "fleet_members_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "fleets_id": {
+ "name": "fleets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folder_access_id": {
+ "name": "folder_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_items_id": {
+ "name": "homepage_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "homepage_layouts_id": {
+ "name": "homepage_layouts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('connect')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_access_id": {
+ "name": "host_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_checks_id": {
+ "name": "host_health_checks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_health_history_id": {
+ "name": "host_health_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_history_id": {
+ "name": "host_metrics_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_metrics_preferences_id": {
+ "name": "host_metrics_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "host_sidebar_preferences_user_id": {
+ "name": "host_sidebar_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('ssh')"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('sha256')"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_data_id": {
+ "name": "ssh_data_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "network_topology_id": {
+ "name": "network_topology_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notification_channels_id": {
+ "name": "notification_channels_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "opkssh_tokens_id": {
+ "name": "opkssh_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "count": {
+ "name": "count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('aggregate-telemetry')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ "plugin_id",
+ "registry_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugin_install_counts_id": {
+ "name": "plugin_install_counts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "capability": {
+ "name": "capability",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ "plugin_id",
+ "capability"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "plugin_permission_grants_id": {
+ "name": "plugin_permission_grants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugin_registries": {
+ "name": "plugin_registries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('community')"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugin_registries_id": {
+ "name": "plugin_registries_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "plugins": {
+ "name": "plugins",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('available')"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('community')"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('disabled')"
+ },
+ "installed_at": {
+ "name": "installed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ "registry_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plugins_id": {
+ "name": "plugins_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_node_history_id": {
+ "name": "proxmox_node_history_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "proxmox_stats_preferences_id": {
+ "name": "proxmox_stats_preferences_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "recent_activity_id": {
+ "name": "recent_activity_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "roles_id": {
+ "name": "roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('onepassword-connect')"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "secret_sources_id": {
+ "name": "secret_sources_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('text')"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_recordings_id": {
+ "name": "session_recordings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_share_participants_id": {
+ "name": "session_share_participants_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('read-only')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "session_shares_id": {
+ "name": "session_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "settings_key": {
+ "name": "settings_key",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('password')"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_credential_secrets_id": {
+ "name": "shared_credential_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_auth_overrides_id": {
+ "name": "shared_host_auth_overrides_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('credential')"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_host_secrets_id": {
+ "name": "shared_host_secrets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('view')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_access_id": {
+ "name": "snippet_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippet_folders_id": {
+ "name": "snippet_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "snippets_id": {
+ "name": "snippets_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credential_usage_id": {
+ "name": "ssh_credential_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_credentials_id": {
+ "name": "ssh_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ssh_folders_id": {
+ "name": "ssh_folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "sso_providers_id": {
+ "name": "sso_providers_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sync_tombstones_id": {
+ "name": "sync_tombstones_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identities_id": {
+ "name": "termix_identities_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_ca_id": {
+ "name": "termix_identity_ca_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "termix_identity_keys_id": {
+ "name": "termix_identity_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tmux_session_tags_id": {
+ "name": "tmux_session_tags_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "transfer_recent_id": {
+ "name": "transfer_recent_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "trusted_devices_id": {
+ "name": "trusted_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "ui_preferences_user_id": {
+ "name": "ui_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_open_tabs_id": {
+ "name": "user_open_tabs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_pin_app_rail_button": {
+ "name": "show_pin_app_rail_button",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_preferences_user_id": {
+ "name": "user_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_roles_id": {
+ "name": "user_roles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('manual')"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_workspaces_id": {
+ "name": "user_workspaces_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "('openid email profile')"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_profiles_id": {
+ "name": "vault_profiles_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "vault_tokens_id": {
+ "name": "vault_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('preferred')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(CURRENT_TIMESTAMP)"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webauthn_credentials_id": {
+ "name": "webauthn_credentials_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/mysql/meta/_journal.json b/drizzle/mysql/meta/_journal.json
index 0d80a6117..7fa976fde 100644
--- a/drizzle/mysql/meta/_journal.json
+++ b/drizzle/mysql/meta/_journal.json
@@ -106,6 +106,69 @@
"when": 1786757023790,
"tag": "0014_bitter_nextwave",
"breakpoints": true
+ },
+ {
+ "idx": 15,
+ "version": "5",
+ "when": 1787576997080,
+ "tag": "0015_red_cobalt_man",
+ "breakpoints": true
+ },
+ {
+ "idx": 16,
+ "version": "5",
+ "when": 1787581983770,
+ "tag": "0016_unusual_tyrannus",
+ "breakpoints": true
+ },
+ {
+ "idx": 17,
+ "version": "5",
+ "when": 1787596414390,
+ "tag": "0017_spicy_proteus",
+ "breakpoints": true
+ },
+ {
+ "idx": 18,
+ "version": "5",
+ "when": 1787600445146,
+ "tag": "0018_fancy_barracuda",
+ "breakpoints": true
+ },
+ {
+ "idx": 19,
+ "version": "5",
+ "when": 1787602480861,
+ "tag": "0019_certain_archangel",
+ "breakpoints": true
+ },
+ {
+ "idx": 20,
+ "version": "5",
+ "when": 1788856825810,
+ "tag": "0020_wise_green_goblin",
+ "breakpoints": true
+ },
+ {
+ "idx": 21,
+ "version": "5",
+ "when": 1789677308051,
+ "tag": "0021_thick_galactus",
+ "breakpoints": true
+ },
+ {
+ "idx": 22,
+ "version": "5",
+ "when": 1789744021971,
+ "tag": "0022_secret_blacklash",
+ "breakpoints": true
+ },
+ {
+ "idx": 23,
+ "version": "5",
+ "when": 1789751455875,
+ "tag": "0023_even_beast",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/drizzle/postgres/0015_early_spitfire.sql b/drizzle/postgres/0015_early_spitfire.sql
new file mode 100644
index 000000000..4ef762fff
--- /dev/null
+++ b/drizzle/postgres/0015_early_spitfire.sql
@@ -0,0 +1,32 @@
+CREATE TABLE "collab_room_members" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "room_id" varchar(255) NOT NULL,
+ "user_id" varchar(255) NOT NULL,
+ "room_role" text DEFAULT 'member' NOT NULL,
+ "added_by" varchar(255),
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "collab_rooms" (
+ "id" varchar(255) PRIMARY KEY NOT NULL,
+ "name" varchar(255) NOT NULL,
+ "owner_user_id" varchar(255) NOT NULL,
+ "persistent" boolean DEFAULT false NOT NULL,
+ "presenter_user_id" varchar(255),
+ "stage_protocol" text,
+ "stage_host_id" integer,
+ "stage_share_id" varchar(255),
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "ended_at" text
+);
+--> statement-breakpoint
+ALTER TABLE "collab_room_members" ADD CONSTRAINT "collab_room_members_room_id_collab_rooms_id_fk" FOREIGN KEY ("room_id") REFERENCES "public"."collab_rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_room_members" ADD CONSTRAINT "collab_room_members_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_room_members" ADD CONSTRAINT "collab_room_members_added_by_users_id_fk" FOREIGN KEY ("added_by") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_rooms" ADD CONSTRAINT "collab_rooms_owner_user_id_users_id_fk" FOREIGN KEY ("owner_user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_rooms" ADD CONSTRAINT "collab_rooms_presenter_user_id_users_id_fk" FOREIGN KEY ("presenter_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_rooms" ADD CONSTRAINT "collab_rooms_stage_host_id_ssh_data_id_fk" FOREIGN KEY ("stage_host_id") REFERENCES "public"."ssh_data"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "collab_rooms" ADD CONSTRAINT "collab_rooms_stage_share_id_session_shares_id_fk" FOREIGN KEY ("stage_share_id") REFERENCES "public"."session_shares"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+CREATE UNIQUE INDEX "idx_collab_room_members_room_user" ON "collab_room_members" USING btree ("room_id","user_id");--> statement-breakpoint
+CREATE INDEX "idx_collab_room_members_user" ON "collab_room_members" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "idx_collab_rooms_owner" ON "collab_rooms" USING btree ("owner_user_id");
\ No newline at end of file
diff --git a/drizzle/postgres/0016_slippery_anita_blake.sql b/drizzle/postgres/0016_slippery_anita_blake.sql
new file mode 100644
index 000000000..999fb9b56
--- /dev/null
+++ b/drizzle/postgres/0016_slippery_anita_blake.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "collab_rooms" ADD COLUMN "guest_link_token" varchar(255);--> statement-breakpoint
+CREATE UNIQUE INDEX "idx_collab_rooms_guest_token" ON "collab_rooms" USING btree ("guest_link_token");
\ No newline at end of file
diff --git a/drizzle/postgres/0017_curved_pet_avengers.sql b/drizzle/postgres/0017_curved_pet_avengers.sql
new file mode 100644
index 000000000..d646607f5
--- /dev/null
+++ b/drizzle/postgres/0017_curved_pet_avengers.sql
@@ -0,0 +1,14 @@
+CREATE TABLE "secret_sources" (
+ "id" varchar(255) PRIMARY KEY NOT NULL,
+ "user_id" varchar(255) NOT NULL,
+ "name" varchar(255) NOT NULL,
+ "kind" text DEFAULT 'onepassword-connect' NOT NULL,
+ "base_url" text NOT NULL,
+ "token" text NOT NULL,
+ "shared" boolean DEFAULT false NOT NULL,
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updated_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "secret_sources" ADD CONSTRAINT "secret_sources_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "idx_secret_sources_user" ON "secret_sources" USING btree ("user_id");
\ No newline at end of file
diff --git a/drizzle/postgres/0018_puzzling_night_nurse.sql b/drizzle/postgres/0018_puzzling_night_nurse.sql
new file mode 100644
index 000000000..72a792b58
--- /dev/null
+++ b/drizzle/postgres/0018_puzzling_night_nurse.sql
@@ -0,0 +1,40 @@
+CREATE TABLE "credential_access" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "credential_id" integer NOT NULL,
+ "user_id" varchar(255),
+ "role_id" integer,
+ "granted_by" varchar(255) NOT NULL,
+ "permission_level" text DEFAULT 'use' NOT NULL,
+ "expires_at" varchar(255),
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "shared_credential_secrets" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "credential_access_id" integer NOT NULL,
+ "target_user_id" varchar(255) NOT NULL,
+ "credential_id" integer NOT NULL,
+ "encrypted_username" text,
+ "auth_type" text DEFAULT 'password' NOT NULL,
+ "encrypted_password" text,
+ "encrypted_key" text,
+ "encrypted_key_password" text,
+ "key_type" text,
+ "public_key" text,
+ "cert_public_key" text,
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updated_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "credential_access" ADD CONSTRAINT "credential_access_credential_id_ssh_credentials_id_fk" FOREIGN KEY ("credential_id") REFERENCES "public"."ssh_credentials"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "credential_access" ADD CONSTRAINT "credential_access_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "credential_access" ADD CONSTRAINT "credential_access_role_id_roles_id_fk" FOREIGN KEY ("role_id") REFERENCES "public"."roles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "credential_access" ADD CONSTRAINT "credential_access_granted_by_users_id_fk" FOREIGN KEY ("granted_by") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "shared_credential_secrets" ADD CONSTRAINT "shared_credential_secrets_credential_access_id_credential_access_id_fk" FOREIGN KEY ("credential_access_id") REFERENCES "public"."credential_access"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "shared_credential_secrets" ADD CONSTRAINT "shared_credential_secrets_target_user_id_users_id_fk" FOREIGN KEY ("target_user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "shared_credential_secrets" ADD CONSTRAINT "shared_credential_secrets_credential_id_ssh_credentials_id_fk" FOREIGN KEY ("credential_id") REFERENCES "public"."ssh_credentials"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "idx_credential_access_user_id" ON "credential_access" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "idx_credential_access_role_id" ON "credential_access" USING btree ("role_id");--> statement-breakpoint
+CREATE INDEX "idx_credential_access_credential_id" ON "credential_access" USING btree ("credential_id");--> statement-breakpoint
+CREATE UNIQUE INDEX "idx_shared_credential_secrets_scope" ON "shared_credential_secrets" USING btree ("credential_access_id","target_user_id");--> statement-breakpoint
+CREATE INDEX "idx_shared_credential_secrets_target" ON "shared_credential_secrets" USING btree ("target_user_id","credential_id");
\ No newline at end of file
diff --git a/drizzle/postgres/0019_oval_puff_adder.sql b/drizzle/postgres/0019_oval_puff_adder.sql
new file mode 100644
index 000000000..c69c6fa99
--- /dev/null
+++ b/drizzle/postgres/0019_oval_puff_adder.sql
@@ -0,0 +1,21 @@
+CREATE TABLE "folder_access" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "owner_user_id" varchar(255) NOT NULL,
+ "folder" varchar(255) NOT NULL,
+ "user_id" varchar(255),
+ "role_id" integer,
+ "granted_by" varchar(255) NOT NULL,
+ "permission_level" text DEFAULT 'connect' NOT NULL,
+ "expires_at" varchar(255),
+ "created_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "ssh_data" ALTER COLUMN "folder" SET DATA TYPE varchar(255);--> statement-breakpoint
+ALTER TABLE "snippets" ALTER COLUMN "folder" SET DATA TYPE varchar(255);--> statement-breakpoint
+ALTER TABLE "ssh_credentials" ALTER COLUMN "folder" SET DATA TYPE varchar(255);--> statement-breakpoint
+ALTER TABLE "vault_profiles" ALTER COLUMN "folder" SET DATA TYPE varchar(255);--> statement-breakpoint
+ALTER TABLE "folder_access" ADD CONSTRAINT "folder_access_owner_user_id_users_id_fk" FOREIGN KEY ("owner_user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "folder_access" ADD CONSTRAINT "folder_access_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "folder_access" ADD CONSTRAINT "folder_access_role_id_roles_id_fk" FOREIGN KEY ("role_id") REFERENCES "public"."roles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "folder_access" ADD CONSTRAINT "folder_access_granted_by_users_id_fk" FOREIGN KEY ("granted_by") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "idx_folder_access_owner_folder" ON "folder_access" USING btree ("owner_user_id","folder");
\ No newline at end of file
diff --git a/drizzle/postgres/0020_mean_slipstream.sql b/drizzle/postgres/0020_mean_slipstream.sql
new file mode 100644
index 000000000..641bbbddc
--- /dev/null
+++ b/drizzle/postgres/0020_mean_slipstream.sql
@@ -0,0 +1,3 @@
+ALTER TABLE "shared_credential_secrets" DROP CONSTRAINT "shared_credential_secrets_credential_access_id_credential_access_id_fk";
+--> statement-breakpoint
+ALTER TABLE "shared_credential_secrets" ADD CONSTRAINT "shared_cred_secrets_access_id_fk" FOREIGN KEY ("credential_access_id") REFERENCES "public"."credential_access"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/postgres/0021_modern_ultron.sql b/drizzle/postgres/0021_modern_ultron.sql
new file mode 100644
index 000000000..56092ec01
--- /dev/null
+++ b/drizzle/postgres/0021_modern_ultron.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "ssh_data" ADD COLUMN "enable_web_ui" boolean DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE "ssh_data" ADD COLUMN "web_ui_config" text;
\ No newline at end of file
diff --git a/drizzle/postgres/0022_demonic_microchip.sql b/drizzle/postgres/0022_demonic_microchip.sql
new file mode 100644
index 000000000..7a61f6caa
--- /dev/null
+++ b/drizzle/postgres/0022_demonic_microchip.sql
@@ -0,0 +1 @@
+ALTER TABLE "ssh_data" ADD COLUMN "enable_ai_assistant" boolean DEFAULT false NOT NULL;
\ No newline at end of file
diff --git a/drizzle/postgres/0023_curvy_meggan.sql b/drizzle/postgres/0023_curvy_meggan.sql
new file mode 100644
index 000000000..61975b156
--- /dev/null
+++ b/drizzle/postgres/0023_curvy_meggan.sql
@@ -0,0 +1,47 @@
+CREATE TABLE "plugin_install_counts" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "plugin_id" varchar(255) NOT NULL,
+ "registry_id" varchar(255) NOT NULL,
+ "count" integer DEFAULT 0 NOT NULL,
+ "source" text DEFAULT 'aggregate-telemetry' NOT NULL,
+ "updated_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "plugin_permission_grants" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "plugin_id" varchar(255) NOT NULL,
+ "capability" varchar(255) NOT NULL,
+ "granted_at" text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "granted_by" varchar(255) NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "plugin_registries" (
+ "id" varchar(255) PRIMARY KEY NOT NULL,
+ "name" varchar(255) NOT NULL,
+ "url" text NOT NULL,
+ "kind" text DEFAULT 'community' NOT NULL,
+ "enabled" boolean DEFAULT true NOT NULL,
+ "signing_key" text,
+ "last_checked_at" text,
+ "last_index_hash" text
+);
+--> statement-breakpoint
+CREATE TABLE "plugins" (
+ "id" varchar(255) PRIMARY KEY NOT NULL,
+ "name" varchar(255) NOT NULL,
+ "version" text NOT NULL,
+ "tier" text DEFAULT 'available' NOT NULL,
+ "source" text DEFAULT 'community' NOT NULL,
+ "registry_id" varchar(255),
+ "state" text DEFAULT 'disabled' NOT NULL,
+ "installed_at" text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updated_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "auto_update" boolean DEFAULT false NOT NULL,
+ "manifest_json" text NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "plugin_permission_grants" ADD CONSTRAINT "plugin_permission_grants_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "plugin_permission_grants" ADD CONSTRAINT "plugin_permission_grants_granted_by_users_id_fk" FOREIGN KEY ("granted_by") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE UNIQUE INDEX "idx_plugin_install_counts_plugin_registry" ON "plugin_install_counts" USING btree ("plugin_id","registry_id");--> statement-breakpoint
+CREATE UNIQUE INDEX "idx_plugin_permission_grants_plugin_capability" ON "plugin_permission_grants" USING btree ("plugin_id","capability");--> statement-breakpoint
+CREATE INDEX "idx_plugins_registry_id" ON "plugins" USING btree ("registry_id");
\ No newline at end of file
diff --git a/drizzle/postgres/0024_flimsy_forge.sql b/drizzle/postgres/0024_flimsy_forge.sql
new file mode 100644
index 000000000..adc9684d1
--- /dev/null
+++ b/drizzle/postgres/0024_flimsy_forge.sql
@@ -0,0 +1 @@
+ALTER TABLE "user_preferences" ADD COLUMN "show_pin_app_rail_button" boolean;
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0015_snapshot.json b/drizzle/postgres/meta/0015_snapshot.json
new file mode 100644
index 000000000..bcaa01b4e
--- /dev/null
+++ b/drizzle/postgres/meta/0015_snapshot.json
@@ -0,0 +1,8734 @@
+{
+ "id": "8c795c60-00fb-4933-8074-99603c79cac3",
+ "prevId": "63268872-e33c-4e4c-ae9d-bd5c7340bf8b",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0016_snapshot.json b/drizzle/postgres/meta/0016_snapshot.json
new file mode 100644
index 000000000..1c2dc5d5b
--- /dev/null
+++ b/drizzle/postgres/meta/0016_snapshot.json
@@ -0,0 +1,8755 @@
+{
+ "id": "6ca8cc9c-18bc-4c6a-bbac-c47a7b1bb62c",
+ "prevId": "8c795c60-00fb-4933-8074-99603c79cac3",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0017_snapshot.json b/drizzle/postgres/meta/0017_snapshot.json
new file mode 100644
index 000000000..87a206746
--- /dev/null
+++ b/drizzle/postgres/meta/0017_snapshot.json
@@ -0,0 +1,8856 @@
+{
+ "id": "270cf0e8-291f-4412-9740-da95ba6951d4",
+ "prevId": "6ca8cc9c-18bc-4c6a-bbac-c47a7b1bb62c",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0018_snapshot.json b/drizzle/postgres/meta/0018_snapshot.json
new file mode 100644
index 000000000..b5502b1c0
--- /dev/null
+++ b/drizzle/postgres/meta/0018_snapshot.json
@@ -0,0 +1,9201 @@
+{
+ "id": "b86379c1-52bf-435f-ab5e-ee622a3b470e",
+ "prevId": "270cf0e8-291f-4412-9740-da95ba6951d4",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_credential_access_id_credential_access_id_fk": {
+ "name": "shared_credential_secrets_credential_access_id_credential_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0019_snapshot.json b/drizzle/postgres/meta/0019_snapshot.json
new file mode 100644
index 000000000..c9d5e0023
--- /dev/null
+++ b/drizzle/postgres/meta/0019_snapshot.json
@@ -0,0 +1,9345 @@
+{
+ "id": "bb7b4ffd-0aef-412a-b942-13e1ec853327",
+ "prevId": "b86379c1-52bf-435f-ab5e-ee622a3b470e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_credential_access_id_credential_access_id_fk": {
+ "name": "shared_credential_secrets_credential_access_id_credential_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0020_snapshot.json b/drizzle/postgres/meta/0020_snapshot.json
new file mode 100644
index 000000000..b6fe77706
--- /dev/null
+++ b/drizzle/postgres/meta/0020_snapshot.json
@@ -0,0 +1,9345 @@
+{
+ "id": "25d31103-f377-4d59-bb12-dc218a4c9e50",
+ "prevId": "bb7b4ffd-0aef-412a-b942-13e1ec853327",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0021_snapshot.json b/drizzle/postgres/meta/0021_snapshot.json
new file mode 100644
index 000000000..4c85ee08e
--- /dev/null
+++ b/drizzle/postgres/meta/0021_snapshot.json
@@ -0,0 +1,9358 @@
+{
+ "id": "e2910f40-dbd5-4eff-b287-204b977aba9f",
+ "prevId": "25d31103-f377-4d59-bb12-dc218a4c9e50",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0022_snapshot.json b/drizzle/postgres/meta/0022_snapshot.json
new file mode 100644
index 000000000..5a0cc4cbf
--- /dev/null
+++ b/drizzle/postgres/meta/0022_snapshot.json
@@ -0,0 +1,9365 @@
+{
+ "id": "76be05f4-e087-46a3-988a-a0a8c87debad",
+ "prevId": "e2910f40-dbd5-4eff-b287-204b977aba9f",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0023_snapshot.json b/drizzle/postgres/meta/0023_snapshot.json
new file mode 100644
index 000000000..3c1548bdf
--- /dev/null
+++ b/drizzle/postgres/meta/0023_snapshot.json
@@ -0,0 +1,9696 @@
+{
+ "id": "10f3f6b9-2580-4075-bd04-cde057814221",
+ "prevId": "76be05f4-e087-46a3-988a-a0a8c87debad",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "count": {
+ "name": "count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'aggregate-telemetry'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ {
+ "expression": "plugin_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "registry_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "capability": {
+ "name": "capability",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ {
+ "expression": "plugin_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "capability",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_registries": {
+ "name": "plugin_registries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'community'"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugins": {
+ "name": "plugins",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'available'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'community'"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'disabled'"
+ },
+ "installed_at": {
+ "name": "installed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ {
+ "expression": "registry_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/0024_snapshot.json b/drizzle/postgres/meta/0024_snapshot.json
new file mode 100644
index 000000000..ca68f5c30
--- /dev/null
+++ b/drizzle/postgres/meta/0024_snapshot.json
@@ -0,0 +1,9702 @@
+{
+ "id": "cbc8ac50-0be9-499f-be2d-3baecbb0c27f",
+ "prevId": "10f3f6b9-2580-4075-bd04-cde057814221",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.ai_conversations": {
+ "name": "ai_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_messages": {
+ "name": "ai_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_proposals": {
+ "name": "ai_proposals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_providers": {
+ "name": "ai_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_firings": {
+ "name": "alert_firings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "value": {
+ "name": "value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ {
+ "expression": "rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "fired_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.alert_rules": {
+ "name": "alert_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_channels": {
+ "name": "automation_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_run_steps": {
+ "name": "automation_run_steps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "step_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_runs": {
+ "name": "automation_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_schedules": {
+ "name": "automation_schedules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ {
+ "expression": "next_due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ {
+ "expression": "automation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.automations": {
+ "name": "automations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_room_members": {
+ "name": "collab_room_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.collab_rooms": {
+ "name": "collab_rooms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ {
+ "expression": "guest_link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.command_history": {
+ "name": "command_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_access": {
+ "name": "credential_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_recent": {
+ "name": "file_manager_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_inventory": {
+ "name": "fleet_inventory",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleet_members": {
+ "name": "fleet_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ {
+ "expression": "fleet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fleets": {
+ "name": "fleets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folder_access": {
+ "name": "folder_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ {
+ "expression": "owner_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_items": {
+ "name": "homepage_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.homepage_layouts": {
+ "name": "homepage_layouts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_access": {
+ "name": "host_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_checks": {
+ "name": "host_health_checks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 300
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_health_history": {
+ "name": "host_health_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_history": {
+ "name": "host_metrics_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_data": {
+ "name": "ssh_data",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ {
+ "expression": "parent_host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.network_topology": {
+ "name": "network_topology",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topology": {
+ "name": "topology",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "count": {
+ "name": "count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'aggregate-telemetry'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ {
+ "expression": "plugin_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "registry_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "capability": {
+ "name": "capability",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ {
+ "expression": "plugin_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "capability",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugin_registries": {
+ "name": "plugin_registries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'community'"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.plugins": {
+ "name": "plugins",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'available'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'community'"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'disabled'"
+ },
+ "installed_at": {
+ "name": "installed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ {
+ "expression": "registry_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "double precision",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.recent_activity": {
+ "name": "recent_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "timestamp",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.secret_sources": {
+ "name": "secret_sources",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_recordings": {
+ "name": "session_recordings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_share_participants": {
+ "name": "session_share_participants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session_shares": {
+ "name": "session_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "link_token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.settings": {
+ "name": "settings",
+ "schema": "",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ {
+ "expression": "credential_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ {
+ "expression": "host_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ {
+ "expression": "host_access_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "protocol",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_access": {
+ "name": "snippet_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ {
+ "expression": "snippet_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippet_folders": {
+ "name": "snippet_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.snippets": {
+ "name": "snippets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ {
+ "expression": "credential_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_credentials": {
+ "name": "ssh_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ssh_folders": {
+ "name": "ssh_folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sso_providers": {
+ "name": "sso_providers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_tombstones": {
+ "name": "sync_tombstones",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identities": {
+ "name": "termix_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "handle": {
+ "name": "handle",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "handle"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 90
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "identity_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.transfer_recent": {
+ "name": "transfer_recent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trusted_devices": {
+ "name": "trusted_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ui_preferences": {
+ "name": "ui_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_open_tabs": {
+ "name": "user_open_tabs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_preferences": {
+ "name": "user_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_pin_app_rail_button": {
+ "name": "show_pin_app_rail_button",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_workspaces": {
+ "name": "user_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_profiles": {
+ "name": "vault_profiles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "sync_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vault_tokens": {
+ "name": "vault_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/postgres/meta/_journal.json b/drizzle/postgres/meta/_journal.json
index ed3a2086e..7a311afd6 100644
--- a/drizzle/postgres/meta/_journal.json
+++ b/drizzle/postgres/meta/_journal.json
@@ -106,6 +106,76 @@
"when": 1786757021444,
"tag": "0014_unusual_maelstrom",
"breakpoints": true
+ },
+ {
+ "idx": 15,
+ "version": "7",
+ "when": 1787576994553,
+ "tag": "0015_early_spitfire",
+ "breakpoints": true
+ },
+ {
+ "idx": 16,
+ "version": "7",
+ "when": 1787581981251,
+ "tag": "0016_slippery_anita_blake",
+ "breakpoints": true
+ },
+ {
+ "idx": 17,
+ "version": "7",
+ "when": 1787596411353,
+ "tag": "0017_curved_pet_avengers",
+ "breakpoints": true
+ },
+ {
+ "idx": 18,
+ "version": "7",
+ "when": 1787600442827,
+ "tag": "0018_puzzling_night_nurse",
+ "breakpoints": true
+ },
+ {
+ "idx": 19,
+ "version": "7",
+ "when": 1787602478567,
+ "tag": "0019_oval_puff_adder",
+ "breakpoints": true
+ },
+ {
+ "idx": 20,
+ "version": "7",
+ "when": 1788856769070,
+ "tag": "0020_mean_slipstream",
+ "breakpoints": true
+ },
+ {
+ "idx": 21,
+ "version": "7",
+ "when": 1788856825316,
+ "tag": "0021_modern_ultron",
+ "breakpoints": true
+ },
+ {
+ "idx": 22,
+ "version": "7",
+ "when": 1789677307514,
+ "tag": "0022_demonic_microchip",
+ "breakpoints": true
+ },
+ {
+ "idx": 23,
+ "version": "7",
+ "when": 1789744021429,
+ "tag": "0023_curvy_meggan",
+ "breakpoints": true
+ },
+ {
+ "idx": 24,
+ "version": "7",
+ "when": 1789751455415,
+ "tag": "0024_flimsy_forge",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/drizzle/sqlite/0011_wakeful_titanium_man.sql b/drizzle/sqlite/0011_wakeful_titanium_man.sql
new file mode 100644
index 000000000..f15f18943
--- /dev/null
+++ b/drizzle/sqlite/0011_wakeful_titanium_man.sql
@@ -0,0 +1,32 @@
+CREATE TABLE `collab_room_members` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `room_id` text NOT NULL,
+ `user_id` text NOT NULL,
+ `room_role` text DEFAULT 'member' NOT NULL,
+ `added_by` text,
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`room_id`) REFERENCES `collab_rooms`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`added_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_collab_room_members_room_user` ON `collab_room_members` (`room_id`,`user_id`);--> statement-breakpoint
+CREATE INDEX `idx_collab_room_members_user` ON `collab_room_members` (`user_id`);--> statement-breakpoint
+CREATE TABLE `collab_rooms` (
+ `id` text PRIMARY KEY NOT NULL,
+ `name` text NOT NULL,
+ `owner_user_id` text NOT NULL,
+ `persistent` integer DEFAULT false NOT NULL,
+ `presenter_user_id` text,
+ `stage_protocol` text,
+ `stage_host_id` integer,
+ `stage_share_id` text,
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `ended_at` text,
+ FOREIGN KEY (`owner_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`presenter_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
+ FOREIGN KEY (`stage_host_id`) REFERENCES `ssh_data`(`id`) ON UPDATE no action ON DELETE set null,
+ FOREIGN KEY (`stage_share_id`) REFERENCES `session_shares`(`id`) ON UPDATE no action ON DELETE set null
+);
+--> statement-breakpoint
+CREATE INDEX `idx_collab_rooms_owner` ON `collab_rooms` (`owner_user_id`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0012_yellow_firedrake.sql b/drizzle/sqlite/0012_yellow_firedrake.sql
new file mode 100644
index 000000000..a29a9d1d7
--- /dev/null
+++ b/drizzle/sqlite/0012_yellow_firedrake.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `collab_rooms` ADD `guest_link_token` text;--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_collab_rooms_guest_token` ON `collab_rooms` (`guest_link_token`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0013_tranquil_master_mold.sql b/drizzle/sqlite/0013_tranquil_master_mold.sql
new file mode 100644
index 000000000..bf13f054d
--- /dev/null
+++ b/drizzle/sqlite/0013_tranquil_master_mold.sql
@@ -0,0 +1,14 @@
+CREATE TABLE `secret_sources` (
+ `id` text PRIMARY KEY NOT NULL,
+ `user_id` text NOT NULL,
+ `name` text NOT NULL,
+ `kind` text DEFAULT 'onepassword-connect' NOT NULL,
+ `base_url` text NOT NULL,
+ `token` text NOT NULL,
+ `shared` integer DEFAULT false NOT NULL,
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE INDEX `idx_secret_sources_user` ON `secret_sources` (`user_id`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0014_lean_doctor_octopus.sql b/drizzle/sqlite/0014_lean_doctor_octopus.sql
new file mode 100644
index 000000000..20ef3f165
--- /dev/null
+++ b/drizzle/sqlite/0014_lean_doctor_octopus.sql
@@ -0,0 +1,40 @@
+CREATE TABLE `credential_access` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `credential_id` integer NOT NULL,
+ `user_id` text,
+ `role_id` integer,
+ `granted_by` text NOT NULL,
+ `permission_level` text DEFAULT 'use' NOT NULL,
+ `expires_at` text,
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE INDEX `idx_credential_access_user_id` ON `credential_access` (`user_id`);--> statement-breakpoint
+CREATE INDEX `idx_credential_access_role_id` ON `credential_access` (`role_id`);--> statement-breakpoint
+CREATE INDEX `idx_credential_access_credential_id` ON `credential_access` (`credential_id`);--> statement-breakpoint
+CREATE TABLE `shared_credential_secrets` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `credential_access_id` integer NOT NULL,
+ `target_user_id` text NOT NULL,
+ `credential_id` integer NOT NULL,
+ `encrypted_username` text,
+ `auth_type` text DEFAULT 'password' NOT NULL,
+ `encrypted_password` text,
+ `encrypted_key` text(16384),
+ `encrypted_key_password` text,
+ `key_type` text,
+ `public_key` text(4096),
+ `cert_public_key` text(8192),
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`credential_access_id`) REFERENCES `credential_access`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`target_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_shared_credential_secrets_scope` ON `shared_credential_secrets` (`credential_access_id`,`target_user_id`);--> statement-breakpoint
+CREATE INDEX `idx_shared_credential_secrets_target` ON `shared_credential_secrets` (`target_user_id`,`credential_id`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0015_glossy_shotgun.sql b/drizzle/sqlite/0015_glossy_shotgun.sql
new file mode 100644
index 000000000..daa06ae67
--- /dev/null
+++ b/drizzle/sqlite/0015_glossy_shotgun.sql
@@ -0,0 +1,17 @@
+CREATE TABLE `folder_access` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `owner_user_id` text NOT NULL,
+ `folder` text NOT NULL,
+ `user_id` text,
+ `role_id` integer,
+ `granted_by` text NOT NULL,
+ `permission_level` text DEFAULT 'connect' NOT NULL,
+ `expires_at` text,
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`owner_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE INDEX `idx_folder_access_owner_folder` ON `folder_access` (`owner_user_id`,`folder`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0016_clever_umar.sql b/drizzle/sqlite/0016_clever_umar.sql
new file mode 100644
index 000000000..568314033
--- /dev/null
+++ b/drizzle/sqlite/0016_clever_umar.sql
@@ -0,0 +1,27 @@
+PRAGMA foreign_keys=OFF;--> statement-breakpoint
+CREATE TABLE `__new_shared_credential_secrets` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `credential_access_id` integer NOT NULL,
+ `target_user_id` text NOT NULL,
+ `credential_id` integer NOT NULL,
+ `encrypted_username` text,
+ `auth_type` text DEFAULT 'password' NOT NULL,
+ `encrypted_password` text,
+ `encrypted_key` text(16384),
+ `encrypted_key_password` text,
+ `key_type` text,
+ `public_key` text(4096),
+ `cert_public_key` text(8192),
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ FOREIGN KEY (`target_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`credential_id`) REFERENCES `ssh_credentials`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`credential_access_id`) REFERENCES `credential_access`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+INSERT INTO `__new_shared_credential_secrets`("id", "credential_access_id", "target_user_id", "credential_id", "encrypted_username", "auth_type", "encrypted_password", "encrypted_key", "encrypted_key_password", "key_type", "public_key", "cert_public_key", "created_at", "updated_at") SELECT "id", "credential_access_id", "target_user_id", "credential_id", "encrypted_username", "auth_type", "encrypted_password", "encrypted_key", "encrypted_key_password", "key_type", "public_key", "cert_public_key", "created_at", "updated_at" FROM `shared_credential_secrets`;--> statement-breakpoint
+DROP TABLE `shared_credential_secrets`;--> statement-breakpoint
+ALTER TABLE `__new_shared_credential_secrets` RENAME TO `shared_credential_secrets`;--> statement-breakpoint
+PRAGMA foreign_keys=ON;--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_shared_credential_secrets_scope` ON `shared_credential_secrets` (`credential_access_id`,`target_user_id`);--> statement-breakpoint
+CREATE INDEX `idx_shared_credential_secrets_target` ON `shared_credential_secrets` (`target_user_id`,`credential_id`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0017_quick_the_hood.sql b/drizzle/sqlite/0017_quick_the_hood.sql
new file mode 100644
index 000000000..bb610b2de
--- /dev/null
+++ b/drizzle/sqlite/0017_quick_the_hood.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `ssh_data` ADD `enable_web_ui` integer DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE `ssh_data` ADD `web_ui_config` text;
\ No newline at end of file
diff --git a/drizzle/sqlite/0018_free_rockslide.sql b/drizzle/sqlite/0018_free_rockslide.sql
new file mode 100644
index 000000000..009a5e0ad
--- /dev/null
+++ b/drizzle/sqlite/0018_free_rockslide.sql
@@ -0,0 +1 @@
+ALTER TABLE `ssh_data` ADD `enable_ai_assistant` integer DEFAULT false NOT NULL;
\ No newline at end of file
diff --git a/drizzle/sqlite/0019_magenta_mongoose.sql b/drizzle/sqlite/0019_magenta_mongoose.sql
new file mode 100644
index 000000000..568769382
--- /dev/null
+++ b/drizzle/sqlite/0019_magenta_mongoose.sql
@@ -0,0 +1,47 @@
+CREATE TABLE `plugin_install_counts` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `plugin_id` text NOT NULL,
+ `registry_id` text NOT NULL,
+ `count` integer DEFAULT 0 NOT NULL,
+ `source` text DEFAULT 'aggregate-telemetry' NOT NULL,
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_plugin_install_counts_plugin_registry` ON `plugin_install_counts` (`plugin_id`,`registry_id`);--> statement-breakpoint
+CREATE TABLE `plugin_permission_grants` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `plugin_id` text NOT NULL,
+ `capability` text NOT NULL,
+ `granted_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `granted_by` text NOT NULL,
+ FOREIGN KEY (`plugin_id`) REFERENCES `plugins`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`granted_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `idx_plugin_permission_grants_plugin_capability` ON `plugin_permission_grants` (`plugin_id`,`capability`);--> statement-breakpoint
+CREATE TABLE `plugin_registries` (
+ `id` text PRIMARY KEY NOT NULL,
+ `name` text NOT NULL,
+ `url` text NOT NULL,
+ `kind` text DEFAULT 'community' NOT NULL,
+ `enabled` integer DEFAULT true NOT NULL,
+ `signing_key` text,
+ `last_checked_at` text,
+ `last_index_hash` text
+);
+--> statement-breakpoint
+CREATE TABLE `plugins` (
+ `id` text PRIMARY KEY NOT NULL,
+ `name` text NOT NULL,
+ `version` text NOT NULL,
+ `tier` text DEFAULT 'available' NOT NULL,
+ `source` text DEFAULT 'community' NOT NULL,
+ `registry_id` text,
+ `state` text DEFAULT 'disabled' NOT NULL,
+ `installed_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ `auto_update` integer DEFAULT false NOT NULL,
+ `manifest_json` text NOT NULL
+);
+--> statement-breakpoint
+CREATE INDEX `idx_plugins_registry_id` ON `plugins` (`registry_id`);
\ No newline at end of file
diff --git a/drizzle/sqlite/0020_moaning_fat_cobra.sql b/drizzle/sqlite/0020_moaning_fat_cobra.sql
new file mode 100644
index 000000000..96713fdda
--- /dev/null
+++ b/drizzle/sqlite/0020_moaning_fat_cobra.sql
@@ -0,0 +1 @@
+ALTER TABLE `user_preferences` ADD `show_pin_app_rail_button` integer;
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0011_snapshot.json b/drizzle/sqlite/meta/0011_snapshot.json
new file mode 100644
index 000000000..db62c52f4
--- /dev/null
+++ b/drizzle/sqlite/meta/0011_snapshot.json
@@ -0,0 +1,8537 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "463f4883-471c-49d1-9319-c01552dd2ede",
+ "prevId": "251d9ba4-91ba-4d6f-aede-22f81c62de80",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0012_snapshot.json b/drizzle/sqlite/meta/0012_snapshot.json
new file mode 100644
index 000000000..e70b7f41e
--- /dev/null
+++ b/drizzle/sqlite/meta/0012_snapshot.json
@@ -0,0 +1,8551 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "348e28a9-73cc-4168-8ad3-6b8f1512d641",
+ "prevId": "463f4883-471c-49d1-9319-c01552dd2ede",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0013_snapshot.json b/drizzle/sqlite/meta/0013_snapshot.json
new file mode 100644
index 000000000..d571f03dd
--- /dev/null
+++ b/drizzle/sqlite/meta/0013_snapshot.json
@@ -0,0 +1,8650 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "e522aea5-91a7-4e5c-bae2-1d425940441d",
+ "prevId": "348e28a9-73cc-4168-8ad3-6b8f1512d641",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0014_snapshot.json b/drizzle/sqlite/meta/0014_snapshot.json
new file mode 100644
index 000000000..8479b62c8
--- /dev/null
+++ b/drizzle/sqlite/meta/0014_snapshot.json
@@ -0,0 +1,8961 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "ac21fbb9-2a4a-4deb-a9a6-e3363eb89c1d",
+ "prevId": "e522aea5-91a7-4e5c-bae2-1d425940441d",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_credential_access_id_credential_access_id_fk": {
+ "name": "shared_credential_secrets_credential_access_id_credential_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0015_snapshot.json b/drizzle/sqlite/meta/0015_snapshot.json
new file mode 100644
index 000000000..bc40cc2ef
--- /dev/null
+++ b/drizzle/sqlite/meta/0015_snapshot.json
@@ -0,0 +1,9098 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "6fa21249-71cd-4ae2-8020-f3782954a031",
+ "prevId": "ac21fbb9-2a4a-4deb-a9a6-e3363eb89c1d",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_credential_access_id_credential_access_id_fk": {
+ "name": "shared_credential_secrets_credential_access_id_credential_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0016_snapshot.json b/drizzle/sqlite/meta/0016_snapshot.json
new file mode 100644
index 000000000..381ee963a
--- /dev/null
+++ b/drizzle/sqlite/meta/0016_snapshot.json
@@ -0,0 +1,9098 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "1c34ddf9-30d6-4bbc-8756-57d4bbd67cea",
+ "prevId": "6fa21249-71cd-4ae2-8020-f3782954a031",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0017_snapshot.json b/drizzle/sqlite/meta/0017_snapshot.json
new file mode 100644
index 000000000..9255adfbe
--- /dev/null
+++ b/drizzle/sqlite/meta/0017_snapshot.json
@@ -0,0 +1,9113 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "48e300d7-3f5b-488c-a612-da033fd6427c",
+ "prevId": "1c34ddf9-30d6-4bbc-8756-57d4bbd67cea",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0018_snapshot.json b/drizzle/sqlite/meta/0018_snapshot.json
new file mode 100644
index 000000000..7a5a05683
--- /dev/null
+++ b/drizzle/sqlite/meta/0018_snapshot.json
@@ -0,0 +1,9121 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "dd13e856-1000-40ce-8ebb-59ccdafe34d2",
+ "prevId": "48e300d7-3f5b-488c-a612-da033fd6427c",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0019_snapshot.json b/drizzle/sqlite/meta/0019_snapshot.json
new file mode 100644
index 000000000..19687f53e
--- /dev/null
+++ b/drizzle/sqlite/meta/0019_snapshot.json
@@ -0,0 +1,9436 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "a93b90fa-2634-426a-bf56-49b364323afe",
+ "prevId": "dd13e856-1000-40ce-8ebb-59ccdafe34d2",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "count": {
+ "name": "count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'aggregate-telemetry'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ "plugin_id",
+ "registry_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "capability": {
+ "name": "capability",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ "plugin_id",
+ "capability"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_registries": {
+ "name": "plugin_registries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'community'"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugins": {
+ "name": "plugins",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'available'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'community'"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'disabled'"
+ },
+ "installed_at": {
+ "name": "installed_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"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ "registry_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/0020_snapshot.json b/drizzle/sqlite/meta/0020_snapshot.json
new file mode 100644
index 000000000..01295c69f
--- /dev/null
+++ b/drizzle/sqlite/meta/0020_snapshot.json
@@ -0,0 +1,9443 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "45f653c4-32e4-49a3-89a3-8e42e4f93c74",
+ "prevId": "a93b90fa-2634-426a-bf56-49b364323afe",
+ "tables": {
+ "ai_conversations": {
+ "name": "ai_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "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": {
+ "idx_ai_conversations_user": {
+ "name": "idx_ai_conversations_user",
+ "columns": [
+ "user_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_conversations_user_id_users_id_fk": {
+ "name": "ai_conversations_user_id_users_id_fk",
+ "tableFrom": "ai_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_messages": {
+ "name": "ai_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "tool_calls": {
+ "name": "tool_calls",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_messages_conversation": {
+ "name": "idx_ai_messages_conversation",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_messages_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_messages_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_messages",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_proposals": {
+ "name": "ai_proposals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "applied_at": {
+ "name": "applied_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "result_summary": {
+ "name": "result_summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ai_proposals_user": {
+ "name": "idx_ai_proposals_user",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "idx_ai_proposals_conversation": {
+ "name": "idx_ai_proposals_conversation",
+ "columns": [
+ "conversation_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ai_proposals_conversation_id_ai_conversations_id_fk": {
+ "name": "ai_proposals_conversation_id_ai_conversations_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "ai_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ai_proposals_user_id_users_id_fk": {
+ "name": "ai_proposals_user_id_users_id_fk",
+ "tableFrom": "ai_proposals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ai_providers": {
+ "name": "ai_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_type": {
+ "name": "provider_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "api_key_prefix": {
+ "name": "api_key_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "default_model": {
+ "name": "default_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "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": {
+ "idx_ai_providers_user_label": {
+ "name": "idx_ai_providers_user_label",
+ "columns": [
+ "user_id",
+ "label"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "ai_providers_user_id_users_id_fk": {
+ "name": "ai_providers_user_id_users_id_fk",
+ "tableFrom": "ai_providers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_firings": {
+ "name": "alert_firings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fired_at": {
+ "name": "fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "severity": {
+ "name": "severity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'warning'"
+ },
+ "acknowledged": {
+ "name": "acknowledged",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_alert_firings_rule": {
+ "name": "idx_alert_firings_rule",
+ "columns": [
+ "rule_id",
+ "fired_at"
+ ],
+ "isUnique": false
+ },
+ "idx_alert_firings_host": {
+ "name": "idx_alert_firings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "alert_firings_user_id_users_id_fk": {
+ "name": "alert_firings_user_id_users_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_firings_rule_id_alert_rules_id_fk": {
+ "name": "alert_firings_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_firings",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rule_channels": {
+ "name": "alert_rule_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "rule_id": {
+ "name": "rule_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "alert_rule_channels_rule_id_alert_rules_id_fk": {
+ "name": "alert_rule_channels_rule_id_alert_rules_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "alert_rules",
+ "columnsFrom": [
+ "rule_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rule_channels_channel_id_notification_channels_id_fk": {
+ "name": "alert_rule_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "alert_rule_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "alert_rules": {
+ "name": "alert_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "threshold_value": {
+ "name": "threshold_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "threshold_duration_seconds": {
+ "name": "threshold_duration_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "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": {
+ "alert_rules_user_id_users_id_fk": {
+ "name": "alert_rules_user_id_users_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "alert_rules_host_id_ssh_data_id_fk": {
+ "name": "alert_rules_host_id_ssh_data_id_fk",
+ "tableFrom": "alert_rules",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_prefix": {
+ "name": "token_prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ }
+ },
+ "indexes": {
+ "idx_api_keys_user_id": {
+ "name": "idx_api_keys_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resource_name": {
+ "name": "resource_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "details": {
+ "name": "details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "success": {
+ "name": "success",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_audit_logs_timestamp": {
+ "name": "idx_audit_logs_timestamp",
+ "columns": [
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_user_ts": {
+ "name": "idx_audit_logs_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_action_ts": {
+ "name": "idx_audit_logs_action_ts",
+ "columns": [
+ "action",
+ "timestamp"
+ ],
+ "isUnique": false
+ },
+ "idx_audit_logs_resource_ts": {
+ "name": "idx_audit_logs_resource_ts",
+ "columns": [
+ "resource_type",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_user_id_users_id_fk": {
+ "name": "audit_logs_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_channels": {
+ "name": "automation_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_channels_pair": {
+ "name": "idx_automation_channels_pair",
+ "columns": [
+ "automation_id",
+ "channel_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_channels_automation_id_automations_id_fk": {
+ "name": "automation_channels_automation_id_automations_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_channels_channel_id_notification_channels_id_fk": {
+ "name": "automation_channels_channel_id_notification_channels_id_fk",
+ "tableFrom": "automation_channels",
+ "tableTo": "notification_channels",
+ "columnsFrom": [
+ "channel_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_run_steps": {
+ "name": "automation_run_steps",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_index": {
+ "name": "step_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "step_type": {
+ "name": "step_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output": {
+ "name": "output",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "truncated": {
+ "name": "truncated",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "idx_automation_run_steps_run": {
+ "name": "idx_automation_run_steps_run",
+ "columns": [
+ "run_id",
+ "step_index"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_run_steps_run_id_automation_runs_id_fk": {
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
+ "tableFrom": "automation_run_steps",
+ "tableTo": "automation_runs",
+ "columnsFrom": [
+ "run_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_runs": {
+ "name": "automation_runs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_type": {
+ "name": "trigger_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trigger_context": {
+ "name": "trigger_context",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "parent_run_id": {
+ "name": "parent_run_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_runs_automation": {
+ "name": "idx_automation_runs_automation",
+ "columns": [
+ "automation_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_automation_runs_user": {
+ "name": "idx_automation_runs_user",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_runs_automation_id_automations_id_fk": {
+ "name": "automation_runs_automation_id_automations_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "automation_runs_user_id_users_id_fk": {
+ "name": "automation_runs_user_id_users_id_fk",
+ "tableFrom": "automation_runs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_schedules": {
+ "name": "automation_schedules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cron": {
+ "name": "cron",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_due_at": {
+ "name": "next_due_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_tick_at": {
+ "name": "last_tick_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_automation_schedules_automation": {
+ "name": "idx_automation_schedules_automation",
+ "columns": [
+ "automation_id"
+ ],
+ "isUnique": true
+ },
+ "idx_automation_schedules_due": {
+ "name": "idx_automation_schedules_due",
+ "columns": [
+ "next_due_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automation_schedules_automation_id_automations_id_fk": {
+ "name": "automation_schedules_automation_id_automations_id_fk",
+ "tableFrom": "automation_schedules",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automation_trigger_state": {
+ "name": "automation_trigger_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "automation_id": {
+ "name": "automation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "state_key": {
+ "name": "state_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "breach_started_at": {
+ "name": "breach_started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_fired_at": {
+ "name": "last_fired_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_value": {
+ "name": "last_value",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_observed_state": {
+ "name": "last_observed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_automation_trigger_state_key": {
+ "name": "idx_automation_trigger_state_key",
+ "columns": [
+ "automation_id",
+ "state_key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "automation_trigger_state_automation_id_automations_id_fk": {
+ "name": "automation_trigger_state_automation_id_automations_id_fk",
+ "tableFrom": "automation_trigger_state",
+ "tableTo": "automations",
+ "columnsFrom": [
+ "automation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "automations": {
+ "name": "automations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "definition": {
+ "name": "definition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "definition_version": {
+ "name": "definition_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "concurrency_policy": {
+ "name": "concurrency_policy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'skip'"
+ },
+ "max_run_seconds": {
+ "name": "max_run_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "dry_run": {
+ "name": "dry_run",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_run_status": {
+ "name": "last_run_status",
+ "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": {
+ "idx_automations_user": {
+ "name": "idx_automations_user",
+ "columns": [
+ "user_id",
+ "enabled"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "automations_user_id_users_id_fk": {
+ "name": "automations_user_id_users_id_fk",
+ "tableFrom": "automations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "c2s_tunnel_presets": {
+ "name": "c2s_tunnel_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "computer_name": {
+ "name": "computer_name",
+ "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": {
+ "c2s_tunnel_presets_user_id_users_id_fk": {
+ "name": "c2s_tunnel_presets_user_id_users_id_fk",
+ "tableFrom": "c2s_tunnel_presets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_room_members": {
+ "name": "collab_room_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "room_role": {
+ "name": "room_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "added_by": {
+ "name": "added_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_collab_room_members_room_user": {
+ "name": "idx_collab_room_members_room_user",
+ "columns": [
+ "room_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_collab_room_members_user": {
+ "name": "idx_collab_room_members_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "collab_room_members_room_id_collab_rooms_id_fk": {
+ "name": "collab_room_members_room_id_collab_rooms_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "collab_rooms",
+ "columnsFrom": [
+ "room_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_user_id_users_id_fk": {
+ "name": "collab_room_members_user_id_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_room_members_added_by_users_id_fk": {
+ "name": "collab_room_members_added_by_users_id_fk",
+ "tableFrom": "collab_room_members",
+ "tableTo": "users",
+ "columnsFrom": [
+ "added_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "collab_rooms": {
+ "name": "collab_rooms",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "persistent": {
+ "name": "persistent",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "presenter_user_id": {
+ "name": "presenter_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_protocol": {
+ "name": "stage_protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_host_id": {
+ "name": "stage_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stage_share_id": {
+ "name": "stage_share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_link_token": {
+ "name": "guest_link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_collab_rooms_owner": {
+ "name": "idx_collab_rooms_owner",
+ "columns": [
+ "owner_user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_collab_rooms_guest_token": {
+ "name": "idx_collab_rooms_guest_token",
+ "columns": [
+ "guest_link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "collab_rooms_owner_user_id_users_id_fk": {
+ "name": "collab_rooms_owner_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_presenter_user_id_users_id_fk": {
+ "name": "collab_rooms_presenter_user_id_users_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "presenter_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_host_id_ssh_data_id_fk": {
+ "name": "collab_rooms_stage_host_id_ssh_data_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "stage_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "collab_rooms_stage_share_id_session_shares_id_fk": {
+ "name": "collab_rooms_stage_share_id_session_shares_id_fk",
+ "tableFrom": "collab_rooms",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "stage_share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "command_history": {
+ "name": "command_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "command": {
+ "name": "command",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "executed_at": {
+ "name": "executed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_command_history_user_host": {
+ "name": "idx_command_history_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "command_history_user_id_users_id_fk": {
+ "name": "command_history_user_id_users_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "command_history_host_id_ssh_data_id_fk": {
+ "name": "command_history_host_id_ssh_data_id_fk",
+ "tableFrom": "command_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_access": {
+ "name": "credential_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'use'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_credential_access_user_id": {
+ "name": "idx_credential_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_role_id": {
+ "name": "idx_credential_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_credential_access_credential_id": {
+ "name": "idx_credential_access_credential_id",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "credential_access_credential_id_ssh_credentials_id_fk": {
+ "name": "credential_access_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_user_id_users_id_fk": {
+ "name": "credential_access_user_id_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_role_id_roles_id_fk": {
+ "name": "credential_access_role_id_roles_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "credential_access_granted_by_users_id_fk": {
+ "name": "credential_access_granted_by_users_id_fk",
+ "tableFrom": "credential_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "credential_sidebar_preferences": {
+ "name": "credential_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "credential_sidebar_preferences_user_id_users_id_fk": {
+ "name": "credential_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "credential_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dashboard_service_links": {
+ "name": "dashboard_service_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "dashboard_service_links_sync_id_unique": {
+ "name": "dashboard_service_links_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "dashboard_service_links_user_id_users_id_fk": {
+ "name": "dashboard_service_links_user_id_users_id_fk",
+ "tableFrom": "dashboard_service_links",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "dismissed_alerts": {
+ "name": "dismissed_alerts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dismissed_at": {
+ "name": "dismissed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_dismissed_alerts_user_id": {
+ "name": "idx_dismissed_alerts_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "dismissed_alerts_user_id_users_id_fk": {
+ "name": "dismissed_alerts_user_id_users_id_fk",
+ "tableFrom": "dismissed_alerts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_pinned": {
+ "name": "file_manager_pinned",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_pinned_user": {
+ "name": "idx_file_manager_pinned_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_pinned_user_id_users_id_fk": {
+ "name": "file_manager_pinned_user_id_users_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_pinned_host_id_ssh_data_id_fk": {
+ "name": "file_manager_pinned_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_pinned",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_recent": {
+ "name": "file_manager_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_opened": {
+ "name": "last_opened",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_recent_user": {
+ "name": "idx_file_manager_recent_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_recent_user_id_users_id_fk": {
+ "name": "file_manager_recent_user_id_users_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_recent_host_id_ssh_data_id_fk": {
+ "name": "file_manager_recent_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "file_manager_shortcuts": {
+ "name": "file_manager_shortcuts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_file_manager_shortcuts_user": {
+ "name": "idx_file_manager_shortcuts_user",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "file_manager_shortcuts_user_id_users_id_fk": {
+ "name": "file_manager_shortcuts_user_id_users_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_manager_shortcuts_host_id_ssh_data_id_fk": {
+ "name": "file_manager_shortcuts_host_id_ssh_data_id_fk",
+ "tableFrom": "file_manager_shortcuts",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_inventory": {
+ "name": "fleet_inventory",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "os_pretty_name": {
+ "name": "os_pretty_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kernel": {
+ "name": "kernel",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "architecture": {
+ "name": "architecture",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "uptime_seconds": {
+ "name": "uptime_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "package_manager": {
+ "name": "package_manager",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collected_at": {
+ "name": "collected_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_inventory_host": {
+ "name": "idx_fleet_inventory_host",
+ "columns": [
+ "host_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_inventory_user": {
+ "name": "idx_fleet_inventory_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_inventory_host_id_ssh_data_id_fk": {
+ "name": "fleet_inventory_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_inventory_user_id_users_id_fk": {
+ "name": "fleet_inventory_user_id_users_id_fk",
+ "tableFrom": "fleet_inventory",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleet_members": {
+ "name": "fleet_members",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fleet_id": {
+ "name": "fleet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "added_at": {
+ "name": "added_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_fleet_members_fleet_host": {
+ "name": "idx_fleet_members_fleet_host",
+ "columns": [
+ "fleet_id",
+ "host_id"
+ ],
+ "isUnique": true
+ },
+ "idx_fleet_members_host": {
+ "name": "idx_fleet_members_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "fleet_members_fleet_id_fleets_id_fk": {
+ "name": "fleet_members_fleet_id_fleets_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "fleets",
+ "columnsFrom": [
+ "fleet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "fleet_members_host_id_ssh_data_id_fk": {
+ "name": "fleet_members_host_id_ssh_data_id_fk",
+ "tableFrom": "fleet_members",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "fleets": {
+ "name": "fleets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tag_rules": {
+ "name": "tag_rules",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "fleets_sync_id_unique": {
+ "name": "fleets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "fleets_user_id_users_id_fk": {
+ "name": "fleets_user_id_users_id_fk",
+ "tableFrom": "fleets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "folder_access": {
+ "name": "folder_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_folder_access_owner_folder": {
+ "name": "idx_folder_access_owner_folder",
+ "columns": [
+ "owner_user_id",
+ "folder"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folder_access_owner_user_id_users_id_fk": {
+ "name": "folder_access_owner_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_user_id_users_id_fk": {
+ "name": "folder_access_user_id_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_role_id_roles_id_fk": {
+ "name": "folder_access_role_id_roles_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folder_access_granted_by_users_id_fk": {
+ "name": "folder_access_granted_by_users_id_fk",
+ "tableFrom": "folder_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_items": {
+ "name": "homepage_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type_id": {
+ "name": "type_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "homepage_items_sync_id_unique": {
+ "name": "homepage_items_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_homepage_items_user_id": {
+ "name": "idx_homepage_items_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "homepage_items_user_id_users_id_fk": {
+ "name": "homepage_items_user_id_users_id_fk",
+ "tableFrom": "homepage_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "homepage_layouts": {
+ "name": "homepage_layouts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "homepage_layouts_user_id_unique": {
+ "name": "homepage_layouts_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "homepage_layouts_user_id_users_id_fk": {
+ "name": "homepage_layouts_user_id_users_id_fk",
+ "tableFrom": "homepage_layouts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_access": {
+ "name": "host_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'connect'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_accessed_at": {
+ "name": "last_accessed_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_count": {
+ "name": "access_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "idx_host_access_user_id": {
+ "name": "idx_host_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_role_id": {
+ "name": "idx_host_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_host_id": {
+ "name": "idx_host_access_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_host_access_expires_at": {
+ "name": "idx_host_access_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "host_access_host_id_ssh_data_id_fk": {
+ "name": "host_access_host_id_ssh_data_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_user_id_users_id_fk": {
+ "name": "host_access_user_id_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_role_id_roles_id_fk": {
+ "name": "host_access_role_id_roles_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_access_granted_by_users_id_fk": {
+ "name": "host_access_granted_by_users_id_fk",
+ "tableFrom": "host_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_checks": {
+ "name": "host_health_checks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "checks": {
+ "name": "checks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 300
+ },
+ "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": {
+ "idx_host_health_checks_user_host": {
+ "name": "idx_host_health_checks_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_health_checks_user_id_users_id_fk": {
+ "name": "host_health_checks_user_id_users_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_checks_host_id_ssh_data_id_fk": {
+ "name": "host_health_checks_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_checks",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_health_history": {
+ "name": "host_health_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "check_id": {
+ "name": "check_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ok": {
+ "name": "ok",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_health_history_user_id_users_id_fk": {
+ "name": "host_health_history_user_id_users_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_health_history_host_id_ssh_data_id_fk": {
+ "name": "host_health_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_health_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_history": {
+ "name": "host_metrics_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_metrics_history_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_history_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_metrics_preferences": {
+ "name": "host_metrics_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_host_metrics_prefs_user_host": {
+ "name": "idx_host_metrics_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "host_metrics_preferences_user_id_users_id_fk": {
+ "name": "host_metrics_preferences_user_id_users_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "host_metrics_preferences_host_id_ssh_data_id_fk": {
+ "name": "host_metrics_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "host_metrics_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "host_sidebar_preferences": {
+ "name": "host_sidebar_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "host_sidebar_preferences_user_id_users_id_fk": {
+ "name": "host_sidebar_preferences_user_id_users_id_fk",
+ "tableFrom": "host_sidebar_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_data": {
+ "name": "ssh_data",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "connection_type": {
+ "name": "connection_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ip": {
+ "name": "ip",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "port": {
+ "name": "port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_host_id": {
+ "name": "parent_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "use_warpgate": {
+ "name": "use_warpgate",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "share_ssh_auth": {
+ "name": "share_ssh_auth",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "force_keyboard_interactive": {
+ "name": "force_keyboard_interactive",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sudo_password": {
+ "name": "sudo_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_password": {
+ "name": "autostart_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key": {
+ "name": "autostart_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "autostart_key_password": {
+ "name": "autostart_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "override_credential_username": {
+ "name": "override_credential_username",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_profile_id": {
+ "name": "vault_profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_terminal": {
+ "name": "enable_terminal",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_session_logging": {
+ "name": "enable_session_logging",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "allow_session_sharing": {
+ "name": "allow_session_sharing",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_command_history": {
+ "name": "enable_command_history",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_tunnel": {
+ "name": "enable_tunnel",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "tunnel_connections": {
+ "name": "tunnel_connections",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "jump_hosts": {
+ "name": "jump_hosts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_file_manager": {
+ "name": "enable_file_manager",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "scp_legacy": {
+ "name": "scp_legacy",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_docker": {
+ "name": "enable_docker",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_web_ui": {
+ "name": "enable_web_ui",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_tmux_monitor": {
+ "name": "enable_tmux_monitor",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_terminal_toolbar": {
+ "name": "enable_terminal_toolbar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_ai_assistant": {
+ "name": "enable_ai_assistant",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_terminal_in_sidebar": {
+ "name": "show_terminal_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "show_file_manager_in_sidebar": {
+ "name": "show_file_manager_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_tunnel_in_sidebar": {
+ "name": "show_tunnel_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_docker_in_sidebar": {
+ "name": "show_docker_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "show_server_stats_in_sidebar": {
+ "name": "show_server_stats_in_sidebar",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "default_path": {
+ "name": "default_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stats_config": {
+ "name": "stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "docker_config": {
+ "name": "docker_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "web_ui_config": {
+ "name": "web_ui_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox": {
+ "name": "enable_proxmox",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_config": {
+ "name": "proxmox_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_proxmox_stats": {
+ "name": "enable_proxmox_stats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "proxmox_stats_config": {
+ "name": "proxmox_stats_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_config": {
+ "name": "terminal_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "quick_actions": {
+ "name": "quick_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enable_ssh": {
+ "name": "enable_ssh",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "enable_rdp": {
+ "name": "enable_rdp",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_vnc": {
+ "name": "enable_vnc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "enable_telnet": {
+ "name": "enable_telnet",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "ssh_port": {
+ "name": "ssh_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 22
+ },
+ "rdp_port": {
+ "name": "rdp_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 3389
+ },
+ "vnc_port": {
+ "name": "vnc_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 5900
+ },
+ "telnet_port": {
+ "name": "telnet_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 23
+ },
+ "rdp_credential_id": {
+ "name": "rdp_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_user": {
+ "name": "rdp_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_password": {
+ "name": "rdp_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_domain": {
+ "name": "rdp_domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_security": {
+ "name": "rdp_security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_ignore_cert": {
+ "name": "rdp_ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "vnc_credential_id": {
+ "name": "vnc_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_password": {
+ "name": "vnc_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_user": {
+ "name": "vnc_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_user": {
+ "name": "telnet_user",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_password": {
+ "name": "telnet_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_credential_id": {
+ "name": "telnet_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_auth_type": {
+ "name": "rdp_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vnc_auth_type": {
+ "name": "vnc_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "telnet_auth_type": {
+ "name": "telnet_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "security": {
+ "name": "security",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ignore_cert": {
+ "name": "ignore_cert",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "guacamole_config": {
+ "name": "guacamole_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "use_socks5": {
+ "name": "use_socks5",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_host": {
+ "name": "socks5_host",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_port": {
+ "name": "socks5_port",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_username": {
+ "name": "socks5_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_password": {
+ "name": "socks5_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "socks5_proxy_chain": {
+ "name": "socks5_proxy_chain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "connection_origin": {
+ "name": "connection_origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mac_address": {
+ "name": "mac_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "wol_broadcast_address": {
+ "name": "wol_broadcast_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "port_knock_sequence": {
+ "name": "port_knock_sequence",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_fingerprint": {
+ "name": "host_key_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_type": {
+ "name": "host_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_algorithm": {
+ "name": "host_key_algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'sha256'"
+ },
+ "host_key_first_seen": {
+ "name": "host_key_first_seen",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_last_verified": {
+ "name": "host_key_last_verified",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_key_changed_count": {
+ "name": "host_key_changed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_data_sync_id_unique": {
+ "name": "ssh_data_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_data_user_id": {
+ "name": "idx_ssh_data_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_parent_host": {
+ "name": "idx_ssh_data_parent_host",
+ "columns": [
+ "parent_host_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_data_credential": {
+ "name": "idx_ssh_data_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_data_user_id_users_id_fk": {
+ "name": "ssh_data_user_id_users_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_data_parent_host_id_ssh_data_id_fk": {
+ "name": "ssh_data_parent_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "parent_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vault_profile_id_vault_profiles_id_fk": {
+ "name": "ssh_data_vault_profile_id_vault_profiles_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "vault_profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_rdp_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_rdp_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "rdp_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_vnc_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_vnc_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "vnc_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "ssh_data_telnet_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_data_telnet_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_data",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "telnet_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "network_topology": {
+ "name": "network_topology",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "topology": {
+ "name": "topology",
+ "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": {
+ "network_topology_user_id_users_id_fk": {
+ "name": "network_topology_user_id_users_id_fk",
+ "tableFrom": "network_topology",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "notification_channels": {
+ "name": "notification_channels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_user_id_users_id_fk": {
+ "name": "notification_channels_user_id_users_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "opkssh_tokens": {
+ "name": "opkssh_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sub": {
+ "name": "sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer": {
+ "name": "issuer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "audience": {
+ "name": "audience",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_opkssh_tokens_user_host": {
+ "name": "idx_opkssh_tokens_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "opkssh_tokens_user_id_users_id_fk": {
+ "name": "opkssh_tokens_user_id_users_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "opkssh_tokens_host_id_ssh_data_id_fk": {
+ "name": "opkssh_tokens_host_id_ssh_data_id_fk",
+ "tableFrom": "opkssh_tokens",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_install_counts": {
+ "name": "plugin_install_counts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "count": {
+ "name": "count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'aggregate-telemetry'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_plugin_install_counts_plugin_registry": {
+ "name": "idx_plugin_install_counts_plugin_registry",
+ "columns": [
+ "plugin_id",
+ "registry_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_permission_grants": {
+ "name": "plugin_permission_grants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "plugin_id": {
+ "name": "plugin_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "capability": {
+ "name": "capability",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugin_permission_grants_plugin_capability": {
+ "name": "idx_plugin_permission_grants_plugin_capability",
+ "columns": [
+ "plugin_id",
+ "capability"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "plugin_permission_grants_plugin_id_plugins_id_fk": {
+ "name": "plugin_permission_grants_plugin_id_plugins_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "plugins",
+ "columnsFrom": [
+ "plugin_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "plugin_permission_grants_granted_by_users_id_fk": {
+ "name": "plugin_permission_grants_granted_by_users_id_fk",
+ "tableFrom": "plugin_permission_grants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugin_registries": {
+ "name": "plugin_registries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'community'"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "signing_key": {
+ "name": "signing_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_index_hash": {
+ "name": "last_index_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "plugins": {
+ "name": "plugins",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tier": {
+ "name": "tier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'available'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'community'"
+ },
+ "registry_id": {
+ "name": "registry_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'disabled'"
+ },
+ "installed_at": {
+ "name": "installed_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"
+ },
+ "auto_update": {
+ "name": "auto_update",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_plugins_registry_id": {
+ "name": "idx_plugins_registry_id",
+ "columns": [
+ "registry_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_node_history": {
+ "name": "proxmox_node_history",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ts": {
+ "name": "ts",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "cpu_percent": {
+ "name": "cpu_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mem_percent": {
+ "name": "mem_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disk_percent": {
+ "name": "disk_percent",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_rx_bytes": {
+ "name": "net_rx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "net_tx_bytes": {
+ "name": "net_tx_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "proxmox_node_history_host_id_ssh_data_id_fk": {
+ "name": "proxmox_node_history_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_node_history",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "proxmox_stats_preferences": {
+ "name": "proxmox_stats_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "layout": {
+ "name": "layout",
+ "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": {
+ "idx_proxmox_stats_prefs_user_host": {
+ "name": "idx_proxmox_stats_prefs_user_host",
+ "columns": [
+ "user_id",
+ "host_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "proxmox_stats_preferences_user_id_users_id_fk": {
+ "name": "proxmox_stats_preferences_user_id_users_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "proxmox_stats_preferences_host_id_ssh_data_id_fk": {
+ "name": "proxmox_stats_preferences_host_id_ssh_data_id_fk",
+ "tableFrom": "proxmox_stats_preferences",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "recent_activity": {
+ "name": "recent_activity",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_name": {
+ "name": "host_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_recent_activity_user_ts": {
+ "name": "idx_recent_activity_user_ts",
+ "columns": [
+ "user_id",
+ "timestamp"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "recent_activity_user_id_users_id_fk": {
+ "name": "recent_activity_user_id_users_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "recent_activity_host_id_ssh_data_id_fk": {
+ "name": "recent_activity_host_id_ssh_data_id_fk",
+ "tableFrom": "recent_activity",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "roles": {
+ "name": "roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_system": {
+ "name": "is_system",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "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": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": [
+ "name"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "secret_sources": {
+ "name": "secret_sources",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'onepassword-connect'"
+ },
+ "base_url": {
+ "name": "base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 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": {
+ "idx_secret_sources_user": {
+ "name": "idx_secret_sources_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "secret_sources_user_id_users_id_fk": {
+ "name": "secret_sources_user_id_users_id_fk",
+ "tableFrom": "secret_sources",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_recordings": {
+ "name": "session_recordings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_id": {
+ "name": "access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "commands": {
+ "name": "commands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "dangerous_actions": {
+ "name": "dangerous_actions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recording_path": {
+ "name": "recording_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "format": {
+ "name": "format",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "terminated_by_owner": {
+ "name": "terminated_by_owner",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "termination_reason": {
+ "name": "termination_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_session_recordings_user_started": {
+ "name": "idx_session_recordings_user_started",
+ "columns": [
+ "user_id",
+ "started_at"
+ ],
+ "isUnique": false
+ },
+ "idx_session_recordings_host": {
+ "name": "idx_session_recordings_host",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_recordings_host_id_ssh_data_id_fk": {
+ "name": "session_recordings_host_id_ssh_data_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_recordings_user_id_users_id_fk": {
+ "name": "session_recordings_user_id_users_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "session_recordings_access_id_host_access_id_fk": {
+ "name": "session_recordings_access_id_host_access_id_fk",
+ "tableFrom": "session_recordings",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_share_participants": {
+ "name": "session_share_participants",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "share_id": {
+ "name": "share_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "guest_label": {
+ "name": "guest_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_share_participants_share_id_session_shares_id_fk": {
+ "name": "session_share_participants_share_id_session_shares_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "session_shares",
+ "columnsFrom": [
+ "share_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_share_participants_user_id_users_id_fk": {
+ "name": "session_share_participants_user_id_users_id_fk",
+ "tableFrom": "session_share_participants",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session_shares": {
+ "name": "session_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_instance_id": {
+ "name": "tab_instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "share_type": {
+ "name": "share_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read-only'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_joined_at": {
+ "name": "last_joined_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "join_count": {
+ "name": "join_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "session_shares_link_token_unique": {
+ "name": "session_shares_link_token_unique",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ },
+ "idx_session_shares_session_id": {
+ "name": "idx_session_shares_session_id",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ },
+ "idx_session_shares_host_id": {
+ "name": "idx_session_shares_host_id",
+ "columns": [
+ "host_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "session_shares_host_id_ssh_data_id_fk": {
+ "name": "session_shares_host_id_ssh_data_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_owner_user_id_users_id_fk": {
+ "name": "session_shares_owner_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "session_shares_target_user_id_users_id_fk": {
+ "name": "session_shares_target_user_id_users_id_fk",
+ "tableFrom": "session_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "jwt_token": {
+ "name": "jwt_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "oidc_sub": {
+ "name": "oidc_sub",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_sid": {
+ "name": "oidc_sid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_active_at": {
+ "name": "last_active_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_sessions_user_id": {
+ "name": "idx_sessions_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_sessions_expires_at": {
+ "name": "idx_sessions_expires_at",
+ "columns": [
+ "expires_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "settings": {
+ "name": "settings",
+ "columns": {
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_credential_secrets": {
+ "name": "shared_credential_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_access_id": {
+ "name": "credential_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'password'"
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "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": {
+ "idx_shared_credential_secrets_scope": {
+ "name": "idx_shared_credential_secrets_scope",
+ "columns": [
+ "credential_access_id",
+ "target_user_id"
+ ],
+ "isUnique": true
+ },
+ "idx_shared_credential_secrets_target": {
+ "name": "idx_shared_credential_secrets_target",
+ "columns": [
+ "target_user_id",
+ "credential_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "shared_credential_secrets_target_user_id_users_id_fk": {
+ "name": "shared_credential_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_credential_secrets_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_credential_secrets_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_cred_secrets_access_id_fk": {
+ "name": "shared_cred_secrets_access_id_fk",
+ "tableFrom": "shared_credential_secrets",
+ "tableTo": "credential_access",
+ "columnsFrom": [
+ "credential_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_auth_overrides": {
+ "name": "shared_host_auth_overrides",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "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": {
+ "shared_host_auth_overrides_host_user_protocol_unique": {
+ "name": "shared_host_auth_overrides_host_user_protocol_unique",
+ "columns": [
+ "host_id",
+ "user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_auth_overrides_host_id_ssh_data_id_fk": {
+ "name": "shared_host_auth_overrides_host_id_ssh_data_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_user_id_users_id_fk": {
+ "name": "shared_host_auth_overrides_user_id_users_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_auth_overrides_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_auth_overrides",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shared_host_secrets": {
+ "name": "shared_host_secrets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "host_access_id": {
+ "name": "host_access_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "protocol": {
+ "name": "protocol",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'ssh'"
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'credential'"
+ },
+ "original_credential_id": {
+ "name": "original_credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_username": {
+ "name": "encrypted_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_auth_type": {
+ "name": "encrypted_auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_password": {
+ "name": "encrypted_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key": {
+ "name": "encrypted_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_password": {
+ "name": "encrypted_key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_key_type": {
+ "name": "encrypted_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "encrypted_domain": {
+ "name": "encrypted_domain",
+ "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": {
+ "idx_shared_host_secrets_scope": {
+ "name": "idx_shared_host_secrets_scope",
+ "columns": [
+ "host_access_id",
+ "target_user_id",
+ "protocol"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "shared_host_secrets_host_access_id_host_access_id_fk": {
+ "name": "shared_host_secrets_host_access_id_host_access_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "host_access",
+ "columnsFrom": [
+ "host_access_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_target_user_id_users_id_fk": {
+ "name": "shared_host_secrets_target_user_id_users_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shared_host_secrets_original_credential_id_ssh_credentials_id_fk": {
+ "name": "shared_host_secrets_original_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "shared_host_secrets",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "original_credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_access": {
+ "name": "snippet_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "snippet_id": {
+ "name": "snippet_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission_level": {
+ "name": "permission_level",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_snippet_access_user_id": {
+ "name": "idx_snippet_access_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_snippet_id": {
+ "name": "idx_snippet_access_snippet_id",
+ "columns": [
+ "snippet_id"
+ ],
+ "isUnique": false
+ },
+ "idx_snippet_access_role_id": {
+ "name": "idx_snippet_access_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippet_access_snippet_id_snippets_id_fk": {
+ "name": "snippet_access_snippet_id_snippets_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "snippets",
+ "columnsFrom": [
+ "snippet_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_user_id_users_id_fk": {
+ "name": "snippet_access_user_id_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_role_id_roles_id_fk": {
+ "name": "snippet_access_role_id_roles_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "snippet_access_granted_by_users_id_fk": {
+ "name": "snippet_access_granted_by_users_id_fk",
+ "tableFrom": "snippet_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippet_folders": {
+ "name": "snippet_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "snippet_folders_sync_id_unique": {
+ "name": "snippet_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "snippet_folders_user_id_users_id_fk": {
+ "name": "snippet_folders_user_id_users_id_fk",
+ "tableFrom": "snippet_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "snippets": {
+ "name": "snippets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "host_filter": {
+ "name": "host_filter",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_note": {
+ "name": "is_note",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "snippets_sync_id_unique": {
+ "name": "snippets_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_snippets_user_id": {
+ "name": "idx_snippets_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "snippets_user_id_users_id_fk": {
+ "name": "snippets_user_id_users_id_fk",
+ "tableFrom": "snippets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credential_usage": {
+ "name": "ssh_credential_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_ssh_credential_usage_credential": {
+ "name": "idx_ssh_credential_usage_credential",
+ "columns": [
+ "credential_id"
+ ],
+ "isUnique": false
+ },
+ "idx_ssh_credential_usage_user": {
+ "name": "idx_ssh_credential_usage_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credential_usage_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_credential_usage_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_host_id_ssh_data_id_fk": {
+ "name": "ssh_credential_usage_host_id_ssh_data_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_credential_usage_user_id_users_id_fk": {
+ "name": "ssh_credential_usage_user_id_users_id_fk",
+ "tableFrom": "ssh_credential_usage",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_credentials": {
+ "name": "ssh_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin": {
+ "name": "pin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auth_type": {
+ "name": "auth_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(16384)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_password": {
+ "name": "key_password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "detected_key_type": {
+ "name": "detected_key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cert_public_key": {
+ "name": "cert_public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usage_count": {
+ "name": "usage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_credentials_sync_id_unique": {
+ "name": "ssh_credentials_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_credentials_user_id": {
+ "name": "idx_ssh_credentials_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_credentials_user_id_users_id_fk": {
+ "name": "ssh_credentials_user_id_users_id_fk",
+ "tableFrom": "ssh_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ssh_folders": {
+ "name": "ssh_folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "ssh_folders_sync_id_unique": {
+ "name": "ssh_folders_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_ssh_folders_user_id": {
+ "name": "idx_ssh_folders_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "ssh_folders_user_id_users_id_fk": {
+ "name": "ssh_folders_user_id_users_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ssh_folders_credential_id_ssh_credentials_id_fk": {
+ "name": "ssh_folders_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "ssh_folders",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "sso_providers": {
+ "name": "sso_providers",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "config": {
+ "name": "config",
+ "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": {}
+ },
+ "sync_tombstones": {
+ "name": "sync_tombstones",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sync_tombstones_user_id_users_id_fk": {
+ "name": "sync_tombstones_user_id_users_id_fk",
+ "tableFrom": "sync_tombstones",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identities": {
+ "name": "termix_identities",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "handle": {
+ "name": "handle",
+ "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": {
+ "termix_identities_user_id_unique": {
+ "name": "termix_identities_user_id_unique",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "termix_identities_handle_unique": {
+ "name": "termix_identities_handle_unique",
+ "columns": [
+ "handle"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identities_user_id_users_id_fk": {
+ "name": "termix_identities_user_id_users_id_fk",
+ "tableFrom": "termix_identities",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_ca": {
+ "name": "termix_identity_ca",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(4096)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "validity_days": {
+ "name": "validity_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 90
+ },
+ "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": {
+ "termix_identity_ca_identity_id_unique": {
+ "name": "termix_identity_ca_identity_id_unique",
+ "columns": [
+ "identity_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "termix_identity_ca_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_ca_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_ca_user_id_users_id_fk": {
+ "name": "termix_identity_ca_user_id_users_id_fk",
+ "tableFrom": "termix_identity_ca",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "termix_identity_keys": {
+ "name": "termix_identity_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "identity_id": {
+ "name": "identity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "termix_identity_keys_identity_id_termix_identities_id_fk": {
+ "name": "termix_identity_keys_identity_id_termix_identities_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "termix_identities",
+ "columnsFrom": [
+ "identity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_user_id_users_id_fk": {
+ "name": "termix_identity_keys_user_id_users_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "termix_identity_keys_credential_id_ssh_credentials_id_fk": {
+ "name": "termix_identity_keys_credential_id_ssh_credentials_id_fk",
+ "tableFrom": "termix_identity_keys",
+ "tableTo": "ssh_credentials",
+ "columnsFrom": [
+ "credential_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "tmux_session_tags": {
+ "name": "tmux_session_tags",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_name": {
+ "name": "session_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tmux_session_tags_user_id_users_id_fk": {
+ "name": "tmux_session_tags_user_id_users_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tmux_session_tags_host_id_ssh_data_id_fk": {
+ "name": "tmux_session_tags_host_id_ssh_data_id_fk",
+ "tableFrom": "tmux_session_tags",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "transfer_recent": {
+ "name": "transfer_recent",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_host_id": {
+ "name": "source_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_host_id": {
+ "name": "dest_host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path": {
+ "name": "dest_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "dest_path_label": {
+ "name": "dest_path_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_transfer_recent_user": {
+ "name": "idx_transfer_recent_user",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "transfer_recent_user_id_users_id_fk": {
+ "name": "transfer_recent_user_id_users_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_source_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_source_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "source_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "transfer_recent_dest_host_id_ssh_data_id_fk": {
+ "name": "transfer_recent_dest_host_id_ssh_data_id_fk",
+ "tableFrom": "transfer_recent",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "dest_host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "trusted_devices": {
+ "name": "trusted_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_fingerprint": {
+ "name": "device_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "device_info": {
+ "name": "device_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_trusted_devices_user_id": {
+ "name": "idx_trusted_devices_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "trusted_devices_user_id_users_id_fk": {
+ "name": "trusted_devices_user_id_users_id_fk",
+ "tableFrom": "trusted_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "ui_preferences": {
+ "name": "ui_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ui_preferences_user_id_users_id_fk": {
+ "name": "ui_preferences_user_id_users_id_fk",
+ "tableFrom": "ui_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_open_tabs": {
+ "name": "user_open_tabs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_type": {
+ "name": "tab_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "host_id": {
+ "name": "host_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tab_order": {
+ "name": "tab_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "backend_session_id": {
+ "name": "backend_session_id",
+ "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": {
+ "idx_user_open_tabs_user_id": {
+ "name": "idx_user_open_tabs_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_open_tabs_user_id_users_id_fk": {
+ "name": "user_open_tabs_user_id_users_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_open_tabs_host_id_ssh_data_id_fk": {
+ "name": "user_open_tabs_host_id_ssh_data_id_fk",
+ "tableFrom": "user_open_tabs",
+ "tableTo": "ssh_data",
+ "columnsFrom": [
+ "host_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_preferences": {
+ "name": "user_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reopen_tabs_on_login": {
+ "name": "reopen_tabs_on_login",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "theme": {
+ "name": "theme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "font_size": {
+ "name": "font_size",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accent_color": {
+ "name": "accent_color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "language": {
+ "name": "language",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storage_mode": {
+ "name": "storage_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_autocomplete": {
+ "name": "command_autocomplete",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "command_palette_enabled": {
+ "name": "command_palette_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_host_tags": {
+ "name": "show_host_tags",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "host_tray_on_click": {
+ "name": "host_tray_on_click",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "pin_app_rail": {
+ "name": "pin_app_rail",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expand_app_rail_on_hover": {
+ "name": "expand_app_rail_on_hover",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_pin_app_rail_button": {
+ "name": "show_pin_app_rail_button",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folders_collapsed": {
+ "name": "folders_collapsed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_snippet_execution": {
+ "name": "confirm_snippet_execution",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "disable_update_check": {
+ "name": "disable_update_check",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "confirm_tab_close": {
+ "name": "confirm_tab_close",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hidden_rail_tabs": {
+ "name": "hidden_rail_tabs",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_assistant_enabled": {
+ "name": "ai_assistant_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ai_read_only_commands": {
+ "name": "ai_read_only_commands",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "compact_host_view": {
+ "name": "compact_host_view",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status_color_scheme": {
+ "name": "status_color_scheme",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_themes": {
+ "name": "custom_themes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "custom_keybindings": {
+ "name": "custom_keybindings",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_defaults": {
+ "name": "terminal_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "rdp_defaults": {
+ "name": "rdp_defaults",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terminal_macros": {
+ "name": "terminal_macros",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_preferences_user_id_users_id_fk": {
+ "name": "user_preferences_user_id_users_id_fk",
+ "tableFrom": "user_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_roles": {
+ "name": "user_roles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "granted_by": {
+ "name": "granted_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "granted_at": {
+ "name": "granted_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {
+ "idx_user_roles_user_role": {
+ "name": "idx_user_roles_user_role",
+ "columns": [
+ "user_id",
+ "role_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_roles_role_id": {
+ "name": "idx_user_roles_role_id",
+ "columns": [
+ "role_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_granted_by_users_id_fk": {
+ "name": "user_roles_granted_by_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "granted_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "user_workspaces": {
+ "name": "user_workspaces",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'manual'"
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "user_workspaces_sync_id_unique": {
+ "name": "user_workspaces_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ },
+ "idx_user_workspaces_user_id": {
+ "name": "idx_user_workspaces_user_id",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "user_workspaces_user_id_users_id_fk": {
+ "name": "user_workspaces_user_id_users_id_fk",
+ "tableFrom": "user_workspaces",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "is_admin": {
+ "name": "is_admin",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "is_oidc": {
+ "name": "is_oidc",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "oidc_identifier": {
+ "name": "oidc_identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sso_provider_id": {
+ "name": "sso_provider_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "client_secret": {
+ "name": "client_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "issuer_url": {
+ "name": "issuer_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "authorization_url": {
+ "name": "authorization_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_url": {
+ "name": "token_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "identifier_path": {
+ "name": "identifier_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "name_path": {
+ "name": "name_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'openid email profile'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_backup_codes": {
+ "name": "totp_backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "registered_at": {
+ "name": "registered_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "donation_modal_dismissed": {
+ "name": "donation_modal_dismissed",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_profiles": {
+ "name": "vault_profiles",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_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
+ },
+ "folder": {
+ "name": "folder",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "vault_addr": {
+ "name": "vault_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "vault_namespace": {
+ "name": "vault_namespace",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_mount": {
+ "name": "oidc_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "oidc_role": {
+ "name": "oidc_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_mount": {
+ "name": "ssh_mount",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ssh_role": {
+ "name": "ssh_role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "valid_principals": {
+ "name": "valid_principals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "key_type": {
+ "name": "key_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "shared": {
+ "name": "shared",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sync_id": {
+ "name": "sync_id",
+ "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": {
+ "vault_profiles_sync_id_unique": {
+ "name": "vault_profiles_sync_id_unique",
+ "columns": [
+ "sync_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_profiles_user_id_users_id_fk": {
+ "name": "vault_profiles_user_id_users_id_fk",
+ "tableFrom": "vault_profiles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "vault_tokens": {
+ "name": "vault_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ssh_cert": {
+ "name": "ssh_cert",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "private_key": {
+ "name": "private_key",
+ "type": "text(8192)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used": {
+ "name": "last_used",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "idx_vault_tokens_user_profile": {
+ "name": "idx_vault_tokens_user_profile",
+ "columns": [
+ "user_id",
+ "profile_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "vault_tokens_user_id_users_id_fk": {
+ "name": "vault_tokens_user_id_users_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vault_tokens_profile_id_vault_profiles_id_fk": {
+ "name": "vault_tokens_profile_id_vault_profiles_id_fk",
+ "tableFrom": "vault_tokens",
+ "tableTo": "vault_profiles",
+ "columnsFrom": [
+ "profile_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "webauthn_credentials": {
+ "name": "webauthn_credentials",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "credential_id": {
+ "name": "credential_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "backed_up": {
+ "name": "backed_up",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "user_verification": {
+ "name": "user_verification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'preferred'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "webauthn_credentials_user_id_users_id_fk": {
+ "name": "webauthn_credentials_user_id_users_id_fk",
+ "tableFrom": "webauthn_credentials",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/sqlite/meta/_journal.json b/drizzle/sqlite/meta/_journal.json
index 5839e4eff..296360311 100644
--- a/drizzle/sqlite/meta/_journal.json
+++ b/drizzle/sqlite/meta/_journal.json
@@ -78,6 +78,76 @@
"when": 1786757019248,
"tag": "0010_mean_queen_noir",
"breakpoints": true
+ },
+ {
+ "idx": 11,
+ "version": "6",
+ "when": 1787576992255,
+ "tag": "0011_wakeful_titanium_man",
+ "breakpoints": true
+ },
+ {
+ "idx": 12,
+ "version": "6",
+ "when": 1787581978969,
+ "tag": "0012_yellow_firedrake",
+ "breakpoints": true
+ },
+ {
+ "idx": 13,
+ "version": "6",
+ "when": 1787596405780,
+ "tag": "0013_tranquil_master_mold",
+ "breakpoints": true
+ },
+ {
+ "idx": 14,
+ "version": "6",
+ "when": 1787600440707,
+ "tag": "0014_lean_doctor_octopus",
+ "breakpoints": true
+ },
+ {
+ "idx": 15,
+ "version": "6",
+ "when": 1787602476319,
+ "tag": "0015_glossy_shotgun",
+ "breakpoints": true
+ },
+ {
+ "idx": 16,
+ "version": "6",
+ "when": 1788856768522,
+ "tag": "0016_clever_umar",
+ "breakpoints": true
+ },
+ {
+ "idx": 17,
+ "version": "6",
+ "when": 1788856824791,
+ "tag": "0017_quick_the_hood",
+ "breakpoints": true
+ },
+ {
+ "idx": 18,
+ "version": "6",
+ "when": 1789677306965,
+ "tag": "0018_free_rockslide",
+ "breakpoints": true
+ },
+ {
+ "idx": 19,
+ "version": "6",
+ "when": 1789744020871,
+ "tag": "0019_magenta_mongoose",
+ "breakpoints": true
+ },
+ {
+ "idx": 20,
+ "version": "6",
+ "when": 1789751454932,
+ "tag": "0020_moaning_fat_cobra",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/electron/backend-failure.cjs b/electron/backend-failure.cjs
new file mode 100644
index 000000000..b30aec06f
--- /dev/null
+++ b/electron/backend-failure.cjs
@@ -0,0 +1,46 @@
+// The embedded backend is a forked child process, so the only evidence the
+// main process gets when it dies is whatever it wrote to stderr on the way
+// out. A port conflict is by far the most common cause (a leftover backend
+// from a hard-killed session, a Termix container bound to the same ports,
+// or an unrelated service on 30001) and it is also the only one the user
+// can actually act on, so it is classified separately from a generic crash
+// and reported with the port that was taken.
+//
+// Every exit reaching here is a failure. Whether the child exited 0, was
+// killed by a signal, or crashed makes no difference to the renderer: the
+// backend process is gone, nothing restarts it, and retrying can never
+// succeed. Only stopBackendServer() knows a shutdown was intentional, and
+// it guards this call rather than encoding that verdict here -- an exit
+// code cannot distinguish "we asked for this" from "something else killed
+// it", and treating a clean-looking exit as benign would leave the
+// renderer waiting forever, which is the failure this classification
+// exists to prevent.
+
+function parseConflictingPort(stderr) {
+ // Node's EADDRINUSE error prints the port twice: once inside the message
+ // ("address already in use :::30001") and once as a numeric `port` field
+ // on the error object. Either is enough, but stderr arrives in chunks and
+ // the tail can be cut off, so both are tried.
+ const fromErrorField = stderr.match(/\bport:\s*(\d{1,5})\b/);
+ if (fromErrorField) return Number(fromErrorField[1]);
+
+ const fromMessage = stderr.match(/address already in use\s+\S*?:(\d{1,5})\b/);
+ if (fromMessage) return Number(fromMessage[1]);
+
+ return null;
+}
+
+/**
+ * Classifies why the embedded backend process ended, from the tail of its
+ * stderr. Always returns a failure -- see the note above on why every exit
+ * that reaches this point counts as one.
+ */
+function classifyBackendFailure(stderr = "") {
+ if (stderr.includes("EADDRINUSE")) {
+ return { reason: "port-in-use", port: parseConflictingPort(stderr) };
+ }
+
+ return { reason: "crashed", port: null };
+}
+
+module.exports = { classifyBackendFailure };
diff --git a/electron/local-files.cjs b/electron/local-files.cjs
new file mode 100644
index 000000000..637db56c3
--- /dev/null
+++ b/electron/local-files.cjs
@@ -0,0 +1,1045 @@
+// Local filesystem access + streamed local<->remote transfers for the
+// desktop app's dual-pane file manager.
+//
+// The renderer has no Node access (contextIsolation), so browsing the user's
+// own disk and moving bytes between it and the backend has to happen here.
+// Uploads/downloads are streamed through Electron's `net` stack against the
+// same file-manager HTTP routes the renderer already uses, so nothing is ever
+// buffered whole in memory.
+//
+// Trust boundary: the renderer never supplies a URL or headers. It names an
+// origin ("local" | "remote") and a route from a fixed allowlist; the main
+// process resolves the actual Termix backend URL and attaches credentials
+// itself (session cookies for the embedded backend, the stored Remote Sync JWT
+// for the remote server). Nothing here can be pointed at another host.
+
+const fs = require("fs");
+const fsp = require("fs/promises");
+const os = require("os");
+const path = require("path");
+const { URL } = require("url");
+
+const IPC = {
+ HOME: "local-fs:home",
+ LIST: "local-fs:list",
+ MKDIR: "local-fs:mkdir",
+ CREATE_FILE: "local-fs:create-file",
+ RENAME: "local-fs:rename",
+ TRASH: "local-fs:trash",
+ ENSURE_DIR: "local-fs:ensure-dir",
+ EXISTS: "local-fs:exists",
+ WALK: "local-fs:walk",
+ REVEAL: "local-fs:reveal",
+ OPEN: "local-fs:open",
+ UPLOAD: "local-transfer:upload",
+ DOWNLOAD: "local-transfer:download",
+ CANCEL: "local-transfer:cancel",
+ PROGRESS: "local-transfer:progress",
+};
+
+const READ_CHUNK_BYTES = 1024 * 1024;
+const PROGRESS_INTERVAL_MS = 150;
+
+const activeTransfers = new Map();
+
+function isAbsoluteLocalPath(candidate) {
+ return typeof candidate === "string" && path.isAbsolute(candidate);
+}
+
+function normalizeLocalPath(candidate) {
+ if (!isAbsoluteLocalPath(candidate)) {
+ throw new Error("A local absolute path is required");
+ }
+ return path.normalize(candidate);
+}
+
+function isHiddenEntry(name) {
+ return name.startsWith(".");
+}
+
+// A single path segment: no separators, not "." / "..", no NULs.
+function requireEntryName(name, what) {
+ const safeName = String(name || "").trim();
+ if (
+ !safeName ||
+ safeName === "." ||
+ safeName === ".." ||
+ /[\/\\\0]/.test(safeName)
+ ) {
+ throw new Error(`Invalid ${what}`);
+ }
+ return safeName;
+}
+
+// Asserts that `candidate` (already absolute) lies strictly inside `root`
+// after normalisation on the *current* platform. `pathImpl` is injectable so
+// the Windows rules can be exercised in tests on any OS. Traversal that
+// survives normalisation ("..\\x" is a plain file name on POSIX but a parent
+// reference on Windows) is caught here, as are absolute / drive-qualified
+// names that path.join or path.resolve would let take over.
+function assertWithinRoot(rootPath, candidate, pathImpl = path) {
+ if (typeof rootPath !== "string" || !rootPath.trim()) {
+ throw new LocalFileError("EINVAL", "A download folder is required");
+ }
+ const root = pathImpl.normalize(pathImpl.resolve(rootPath));
+ const target = pathImpl.normalize(pathImpl.resolve(candidate));
+ const rel = pathImpl.relative(root, target);
+ const escapes =
+ rel === "" ||
+ rel === ".." ||
+ rel.startsWith(`..${pathImpl.sep}`) ||
+ pathImpl.isAbsolute(rel) ||
+ // A different drive on Windows yields an absolute relative path; a UNC
+ // or drive-qualified segment must never survive either.
+ rel.split(pathImpl.sep).some((seg) => seg === ".." || seg === "");
+ if (escapes) {
+ throw new LocalFileError(
+ "EINVAL",
+ `"${pathImpl.basename(candidate)}" would be written outside the selected folder`,
+ );
+ }
+ return target;
+}
+
+// Resolve a deliberately selected linked root once, but never follow links
+// supplied as descendants of a downloaded tree.
+async function prepareDownloadPath(rootPath, candidate, directory = false) {
+ const target = assertWithinRoot(rootPath, normalizeLocalPath(candidate));
+ const selected = path.resolve(rootPath);
+ const realRoot = await fsp.realpath(selected);
+ if (!(await fsp.stat(realRoot)).isDirectory()) {
+ throw new LocalFileError("EINVAL", "The download root is not a directory");
+ }
+ const parts = path.relative(selected, target).split(path.sep);
+ let current = realRoot;
+ for (let i = 0; i < parts.length; i++) {
+ current = path.join(current, parts[i]);
+ const needsDirectory = directory || i < parts.length - 1;
+ if (needsDirectory) {
+ await fsp.mkdir(current).catch((error) => {
+ if (error.code !== "EEXIST") throw error;
+ });
+ }
+ const stat = await fsp.lstat(current).catch((error) => {
+ if (error.code === "ENOENT" && !needsDirectory) return null;
+ throw error;
+ });
+ if (stat?.isSymbolicLink()) {
+ throw new LocalFileError(
+ "EINVAL",
+ "Downloads cannot follow links inside the selected folder",
+ );
+ }
+ if (needsDirectory && !stat.isDirectory()) {
+ throw new LocalFileError(
+ "ENOTDIR",
+ "A download parent is not a directory",
+ );
+ }
+ }
+ return { root: realRoot, path: current };
+}
+
+async function pathExists(target) {
+ try {
+ await fsp.lstat(target);
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+async function describeEntry(dirPath, dirent) {
+ const entryPath = path.join(dirPath, dirent.name);
+ let type = "file";
+ let size = 0;
+ let modifiedTimestamp;
+ let linkTarget;
+
+ try {
+ if (dirent.isSymbolicLink()) {
+ type = "link";
+ try {
+ linkTarget = await fsp.readlink(entryPath);
+ } catch {
+ // dangling or unreadable link
+ }
+ // Follow the link so a symlinked directory still navigates like one.
+ try {
+ const target = await fsp.stat(entryPath);
+ if (target.isDirectory()) type = "directory";
+ size = target.size;
+ modifiedTimestamp = target.mtimeMs;
+ } catch {
+ const own = await fsp.lstat(entryPath);
+ modifiedTimestamp = own.mtimeMs;
+ }
+ } else if (dirent.isDirectory()) {
+ type = "directory";
+ const stat = await fsp.stat(entryPath);
+ modifiedTimestamp = stat.mtimeMs;
+ } else {
+ const stat = await fsp.stat(entryPath);
+ size = stat.size;
+ modifiedTimestamp = stat.mtimeMs;
+ }
+ } catch {
+ // Unreadable entry: still list it so the user sees it exists.
+ }
+
+ return {
+ name: dirent.name,
+ path: entryPath,
+ type,
+ size,
+ modifiedTimestamp,
+ linkTarget,
+ hidden: isHiddenEntry(dirent.name),
+ };
+}
+
+async function listDirectory(dirPath) {
+ const resolved = normalizeLocalPath(dirPath);
+ const dirents = await fsp.readdir(resolved, { withFileTypes: true });
+ const entries = await Promise.all(
+ dirents.map((dirent) => describeEntry(resolved, dirent)),
+ );
+ const parent = path.dirname(resolved);
+ return {
+ path: resolved,
+ parent: parent === resolved ? null : parent,
+ entries,
+ };
+}
+
+// Expands a set of dropped local paths into the flat list of files (with
+// paths relative to the drop root) plus any empty directories, mirroring what
+// the browser's FileSystemEntry walker produces for OS drops.
+async function walkPaths(rootPaths) {
+ const files = [];
+ const emptyDirs = [];
+ let totalBytes = 0;
+
+ async function walkDir(absDir, relDir) {
+ const dirents = await fsp.readdir(absDir, { withFileTypes: true });
+ if (dirents.length === 0) {
+ emptyDirs.push(relDir);
+ return;
+ }
+ for (const dirent of dirents) {
+ const abs = path.join(absDir, dirent.name);
+ const rel = `${relDir}/${dirent.name}`;
+ if (dirent.isDirectory()) {
+ await walkDir(abs, rel);
+ } else if (dirent.isFile()) {
+ const stat = await fsp.stat(abs);
+ files.push({ localPath: abs, relativePath: rel, size: stat.size });
+ totalBytes += stat.size;
+ } else if (dirent.isSymbolicLink()) {
+ // Upload what the link points at, if it is a regular file.
+ try {
+ const stat = await fsp.stat(abs);
+ if (stat.isFile()) {
+ files.push({ localPath: abs, relativePath: rel, size: stat.size });
+ totalBytes += stat.size;
+ }
+ } catch {
+ // dangling link: skip
+ }
+ }
+ }
+ }
+
+ for (const rootPath of rootPaths) {
+ const abs = normalizeLocalPath(rootPath);
+ const stat = await fsp.stat(abs);
+ const name = path.basename(abs);
+ if (stat.isDirectory()) {
+ await walkDir(abs, name);
+ } else if (stat.isFile()) {
+ files.push({ localPath: abs, relativePath: name, size: stat.size });
+ totalBytes += stat.size;
+ }
+ }
+
+ return { files, emptyDirs, totalBytes };
+}
+
+function toHeaderMap(headers) {
+ const out = {};
+ if (!headers || typeof headers !== "object") return out;
+ for (const [key, value] of Object.entries(headers)) {
+ if (value === undefined || value === null) continue;
+ out[key] = String(value);
+ }
+ return out;
+}
+
+function makeProgressReporter(sender, transferId) {
+ let lastSentAt = 0;
+ return (transferred, total, force = false) => {
+ const now = Date.now();
+ if (!force && now - lastSentAt < PROGRESS_INTERVAL_MS) return;
+ lastSentAt = now;
+ if (sender.isDestroyed()) return;
+ sender.send(IPC.PROGRESS, { transferId, transferred, total });
+ };
+}
+
+function collectBody(response) {
+ return new Promise((resolve) => {
+ const chunks = [];
+ response.on("data", (chunk) => chunks.push(chunk));
+ response.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
+ response.on("error", () => resolve(""));
+ });
+}
+
+function describeHttpError(statusCode, bodyText) {
+ try {
+ const parsed = JSON.parse(bodyText);
+ if (parsed && typeof parsed.error === "string") return parsed.error;
+ if (parsed && typeof parsed.message === "string") return parsed.message;
+ } catch {
+ // not JSON
+ }
+ return bodyText?.trim() || `Request failed with status ${statusCode}`;
+}
+
+function writeToRequest(request, chunk) {
+ return new Promise((resolve, reject) => {
+ try {
+ request.write(chunk, () => resolve());
+ } catch (error) {
+ reject(error);
+ }
+ });
+}
+
+const TRANSFER_ROUTES = Object.freeze({
+ uploadFileStream: "/ssh/uploadFileStream",
+ downloadFileStream: "/ssh/downloadFileStream",
+});
+
+const DEVICE_ID_PATTERN = /^[A-Za-z0-9._:-]{1,128}$/;
+// A compact JWT (base64url segments joined by dots); anything else is refused.
+const AUTH_TOKEN_PATTERN = /^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/;
+
+const DEFAULT_LOCAL_FILE_MANAGER_BASE =
+ "http://localhost:30004/ssh/file_manager";
+
+function normalizeHttpBase(candidate, what) {
+ let parsed;
+ try {
+ parsed = new URL(String(candidate || ""));
+ } catch {
+ throw new Error(`${what} is not a valid URL`);
+ }
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
+ throw new Error(`${what} must use http or https`);
+ }
+ return parsed.toString().replace(/\/$/, "");
+}
+
+// Resolves where a transfer may go. Only the two file-manager streaming
+// routes are reachable, and only on the embedded backend or the configured
+// Remote Sync server; credentials come from the main process, not the caller.
+function createTargetResolver({
+ localBaseUrl = DEFAULT_LOCAL_FILE_MANAGER_BASE,
+ getRemoteSyncConfig,
+ getRemoteSyncJwt,
+}) {
+ return function resolveTransferTarget({
+ origin,
+ route,
+ deviceId,
+ authToken,
+ } = {}) {
+ const routePath = TRANSFER_ROUTES[route];
+ if (!routePath) {
+ throw new Error(`Unknown transfer route: ${String(route)}`);
+ }
+
+ const headers = { "X-Electron-App": "true" };
+ if (deviceId !== undefined && deviceId !== null && deviceId !== "") {
+ if (typeof deviceId !== "string" || !DEVICE_ID_PATTERN.test(deviceId)) {
+ throw new Error("Invalid device id");
+ }
+ headers["X-Termix-Device-ID"] = deviceId;
+ }
+
+ if (origin === "local") {
+ // The desktop renderer authenticates against the embedded backend with
+ // the token it keeps in localStorage (see the Electron branch of the
+ // axios request interceptor), and the `jwt` cookie only exists for a
+ // while after an interactive login. Send that same token here, so a
+ // transfer does not depend on a cookie the rest of the app no longer
+ // needs; the session cookie still rides along as a fallback. The
+ // renderer already uses this token on every request it makes itself,
+ // so forwarding it grants nothing new, and the URL stays ours.
+ if (authToken !== undefined && authToken !== null && authToken !== "") {
+ if (
+ typeof authToken !== "string" ||
+ authToken.length > 8192 ||
+ !AUTH_TOKEN_PATTERN.test(authToken)
+ ) {
+ throw new Error("Invalid auth token");
+ }
+ headers.Authorization = `Bearer ${authToken}`;
+ }
+ return {
+ url: `${normalizeHttpBase(localBaseUrl, "Local backend URL")}${routePath}`,
+ headers,
+ };
+ }
+
+ if (origin === "remote") {
+ const config =
+ typeof getRemoteSyncConfig === "function"
+ ? getRemoteSyncConfig()
+ : null;
+ if (!config || !config.serverUrl) {
+ throw new Error("Remote sync server is not configured");
+ }
+ const base = normalizeHttpBase(
+ config.serverUrl,
+ "Remote sync server URL",
+ );
+ const jwt =
+ typeof getRemoteSyncJwt === "function" ? getRemoteSyncJwt() : null;
+ if (jwt) headers.Authorization = `Bearer ${jwt}`;
+ return { url: `${base}/ssh/file_manager${routePath}`, headers };
+ }
+
+ throw new Error(`Unknown transfer origin: ${String(origin)}`);
+ };
+}
+
+function createNetRequest(net, event, method, url) {
+ return net.request({
+ method,
+ url,
+ session: event.sender.session,
+ useSessionCookies: true,
+ });
+}
+
+// Streams one local file to the backend's multipart `uploadFileStream` route.
+async function uploadLocalFile({ net, resolveTransferTarget }, event, options) {
+ const {
+ transferId,
+ origin,
+ deviceId,
+ authToken,
+ fields,
+ localPath,
+ fileName,
+ } = options || {};
+
+ if (!transferId || !localPath) {
+ throw new Error("Missing upload parameters");
+ }
+ const { url, headers } = resolveTransferTarget({
+ origin,
+ route: "uploadFileStream",
+ deviceId,
+ authToken,
+ });
+
+ const absPath = normalizeLocalPath(localPath);
+ const stat = await fsp.stat(absPath);
+ if (!stat.isFile()) {
+ throw new Error("Only regular files can be uploaded");
+ }
+
+ const boundary = `----TermixLocalUpload${Date.now()}${Math.random()
+ .toString(36)
+ .slice(2)}`;
+ const safeName = String(fileName || path.basename(absPath))
+ .replace(/[\r\n]/g, " ")
+ .replace(/"/g, "%22");
+
+ let preamble = "";
+ for (const [key, value] of Object.entries(fields || {})) {
+ if (value === undefined || value === null) continue;
+ preamble +=
+ `--${boundary}\r\n` +
+ `Content-Disposition: form-data; name="${key}"\r\n\r\n` +
+ `${String(value)}\r\n`;
+ }
+ preamble +=
+ `--${boundary}\r\n` +
+ `Content-Disposition: form-data; name="file"; filename="${safeName}"\r\n` +
+ `Content-Type: application/octet-stream\r\n\r\n`;
+ const epilogue = `\r\n--${boundary}--\r\n`;
+
+ const preambleBuffer = Buffer.from(preamble, "utf8");
+ const epilogueBuffer = Buffer.from(epilogue, "utf8");
+
+ const request = createNetRequest(net, event, "POST", url);
+ for (const [key, value] of Object.entries(toHeaderMap(headers))) {
+ request.setHeader(key, value);
+ }
+ request.setHeader(
+ "Content-Type",
+ `multipart/form-data; boundary=${boundary}`,
+ );
+ // Without chunked encoding Electron buffers the whole body in the main
+ // process before sending; chunked keeps memory flat for multi-GB files.
+ // Busboy on the backend parses the multipart stream incrementally either way.
+ request.chunkedEncoding = true;
+
+ const report = makeProgressReporter(event.sender, transferId);
+ const readStream = fs.createReadStream(absPath, {
+ highWaterMark: READ_CHUNK_BYTES,
+ });
+
+ const state = {
+ cancelled: false,
+ abort: () => {
+ state.cancelled = true;
+ readStream.destroy();
+ request.abort();
+ },
+ };
+ activeTransfers.set(transferId, state);
+
+ // The server may answer early (auth failure, missing session) while the
+ // body is still streaming; stop pushing bytes as soon as it does.
+ let responded = false;
+ const responsePromise = new Promise((resolve, reject) => {
+ request.on("response", async (response) => {
+ responded = true;
+ const bodyText = await collectBody(response);
+ resolve({ statusCode: response.statusCode, bodyText });
+ });
+ request.on("error", (error) => reject(error));
+ request.on("abort", () => reject(new Error("Transfer cancelled")));
+ });
+ // Avoid an unhandled rejection if we bail out before awaiting below.
+ responsePromise.catch(() => {});
+
+ // A write callback never fires once the request has errored or been
+ // aborted, so every write races against the response promise's rejection.
+ const write = (chunk) =>
+ Promise.race([writeToRequest(request, chunk), responsePromise]);
+
+ try {
+ await write(preambleBuffer);
+ let sent = 0;
+ for await (const chunk of readStream) {
+ if (state.cancelled) throw new Error("Transfer cancelled");
+ if (responded) break;
+ await write(chunk);
+ sent += chunk.length;
+ report(sent, stat.size);
+ }
+ if (!responded) {
+ await write(epilogueBuffer);
+ request.end();
+ }
+
+ const { statusCode, bodyText } = await responsePromise;
+ if (statusCode < 200 || statusCode >= 300) {
+ throw new Error(describeHttpError(statusCode, bodyText));
+ }
+ report(stat.size, stat.size, true);
+ return { success: true, bytes: stat.size };
+ } catch (error) {
+ readStream.destroy();
+ throw error;
+ } finally {
+ activeTransfers.delete(transferId);
+ }
+}
+
+class LocalFileError extends Error {
+ constructor(code, message) {
+ super(message);
+ this.name = "LocalFileError";
+ this.code = code;
+ }
+}
+
+// Destinations with a download in flight, so two transfers can never race
+// each other onto the same file.
+const activeDestinations = new Set();
+
+function partialPathFor(absDest, transferId) {
+ const token = String(transferId)
+ .replace(/[^A-Za-z0-9_-]/g, "")
+ .slice(0, 48);
+ return `${absDest}.${token || "transfer"}.termix-part`;
+}
+
+// File operations used to publish a download, injectable so the replace
+// strategy can be tested against Windows-like semantics (where rename() onto
+// an existing name fails) without running on Windows.
+const defaultPublishFs = Object.freeze({
+ rename: (from, to) => fsp.rename(from, to),
+ link: (from, to) => fsp.link(from, to),
+ copyFileExcl: (from, to) =>
+ fsp.copyFile(from, to, fs.constants.COPYFILE_EXCL),
+ rm: (target) => fsp.rm(target, { force: true }),
+ lstat: (target) => fsp.lstat(target),
+});
+
+function replacedPathFor(absDest, transferId) {
+ const token = String(transferId)
+ .replace(/[^A-Za-z0-9_-]/g, "")
+ .slice(0, 48);
+ return `${absDest}.${token || "transfer"}.termix-replaced`;
+}
+
+// Puts `sourcePath` under `absDest` without ever replacing an existing file:
+// link() is atomic and fails with EEXIST if the name is taken; filesystems
+// without hard links fall back to an exclusive copy. The source is removed
+// once the destination exists.
+async function publishExclusive(io, sourcePath, absDest) {
+ const exists = () =>
+ new LocalFileError("EEXIST", `"${path.basename(absDest)}" already exists`);
+ try {
+ await io.link(sourcePath, absDest);
+ } catch (error) {
+ if (error && error.code === "EEXIST") throw exists();
+ try {
+ await io.copyFileExcl(sourcePath, absDest);
+ } catch (copyError) {
+ if (copyError && copyError.code === "EEXIST") throw exists();
+ throw copyError;
+ }
+ }
+ await io.rm(sourcePath);
+}
+
+// Replaces `absDest` with the finished partial. rename() over an existing
+// file is not portable: POSIX replaces it, but on Windows the call commonly
+// fails (EEXIST / EPERM, always when the file is open), so the swap never
+// renames onto an occupied name. Instead:
+// 1. move the current file aside to a transfer-unique sibling
+// (renaming to a fresh name is safe everywhere);
+// 2. publish the partial exclusively under the now-free name;
+// 3. delete the aside copy.
+// If step 1 fails nothing has changed and the caller gets EBUSY. If step 2
+// fails the aside copy is moved back, so the original survives.
+async function replaceExisting(io, partialPath, absDest, transferId) {
+ let current;
+ try {
+ current = await io.lstat(absDest);
+ } catch (error) {
+ if (error && error.code === "ENOENT") {
+ // Nothing to replace after all (the file went away meanwhile).
+ await publishExclusive(io, partialPath, absDest);
+ return;
+ }
+ throw error;
+ }
+ if (current.isDirectory()) {
+ throw new LocalFileError(
+ "EISDIR",
+ `"${path.basename(absDest)}" is a folder and cannot be replaced by a file`,
+ );
+ }
+
+ const asidePath = replacedPathFor(absDest, transferId);
+ try {
+ await io.rename(absDest, asidePath);
+ } catch (error) {
+ if (
+ error &&
+ (error.code === "EPERM" ||
+ error.code === "EBUSY" ||
+ error.code === "EACCES")
+ ) {
+ throw new LocalFileError(
+ "EBUSY",
+ `"${path.basename(absDest)}" is in use and could not be replaced`,
+ );
+ }
+ throw error;
+ }
+
+ try {
+ await publishExclusive(io, partialPath, absDest);
+ } catch (error) {
+ // Put the original back under its name; the partial is cleaned up by
+ // the caller.
+ await io.rm(absDest).catch(() => {});
+ await io.rename(asidePath, absDest).catch(() => {});
+ throw error;
+ }
+
+ // The old contents are no longer reachable under the real name; removing
+ // the aside copy can still fail on Windows if another process holds it
+ // open, so retry once before giving up and leaving it for the user.
+ try {
+ await io.rm(asidePath);
+ } catch {
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ await io.rm(asidePath).catch((error) => {
+ console.warn(
+ `[local-files] replaced "${absDest}" but could not remove the previous copy at "${asidePath}": ${error && error.message}`,
+ );
+ });
+ }
+}
+
+// Moves a finished partial file onto its final name. Without `overwrite` the
+// publish is exclusive: an existing file is never replaced, even if it
+// appeared while the download was running. With `overwrite` the existing file
+// is swapped out in a way that also works on Windows.
+async function publishDownload(
+ partialPath,
+ absDest,
+ overwrite,
+ transferId,
+ io = defaultPublishFs,
+) {
+ if (overwrite) {
+ await replaceExisting(io, partialPath, absDest, transferId);
+ return;
+ }
+ await publishExclusive(io, partialPath, absDest);
+}
+
+// Streams one remote file (via the backend's `downloadFileStream` route) into
+// a local destination. Bytes go to a transfer-unique temp sibling first and
+// are published under the real name only on success, so a failed transfer
+// never leaves a truncated file behind. Existing files are refused unless
+// the caller explicitly asked to overwrite.
+async function downloadToLocal(
+ { net, resolveTransferTarget, publishFs },
+ event,
+ options,
+) {
+ const {
+ transferId,
+ origin,
+ deviceId,
+ authToken,
+ body,
+ destPath,
+ rootPath,
+ expectedSize,
+ } = options || {};
+ const overwrite = options?.overwrite === true;
+
+ if (!transferId || !destPath) {
+ throw new Error("Missing download parameters");
+ }
+ const { url, headers } = resolveTransferTarget({
+ origin,
+ route: "downloadFileStream",
+ deviceId,
+ authToken,
+ });
+
+ // The renderer builds destPath from remote names; never trust that it
+ // stayed inside the folder the user picked.
+ const destination = await prepareDownloadPath(rootPath, destPath);
+ const absDest = destination.path;
+ if (activeDestinations.has(absDest)) {
+ throw new LocalFileError(
+ "EBUSY",
+ `"${path.basename(absDest)}" is already being downloaded`,
+ );
+ }
+ activeDestinations.add(absDest);
+
+ const partialPath = partialPathFor(
+ path.join(destination.root, path.basename(absDest)),
+ transferId,
+ );
+ const report = makeProgressReporter(event.sender, transferId);
+ const state = {
+ cancelled: false,
+ abort: () => {
+ state.cancelled = true;
+ request.abort();
+ },
+ };
+ let request = null;
+
+ try {
+ if (!overwrite && (await pathExists(absDest))) {
+ throw new LocalFileError(
+ "EEXIST",
+ `"${path.basename(absDest)}" already exists`,
+ );
+ }
+
+ request = createNetRequest(net, event, "POST", url);
+ for (const [key, value] of Object.entries(toHeaderMap(headers))) {
+ request.setHeader(key, value);
+ }
+ const payload = Buffer.from(JSON.stringify(body || {}), "utf8");
+ request.setHeader("Content-Type", "application/json");
+ // No explicit Content-Length: Electron's net module forbids apps from
+ // setting it (the request fails with net::ERR_INVALID_ARGUMENT) and
+ // computes it itself from the buffered body when chunked encoding is off.
+ activeTransfers.set(transferId, state);
+
+ await new Promise((resolve, reject) => {
+ let settled = false;
+ const fail = (error) => {
+ if (settled) return;
+ settled = true;
+ reject(error);
+ };
+
+ request.on("error", fail);
+ request.on("abort", () => fail(new Error("Transfer cancelled")));
+ request.on("response", (response) => {
+ const statusCode = response.statusCode;
+ if (statusCode < 200 || statusCode >= 300) {
+ collectBody(response).then((bodyText) =>
+ fail(new Error(describeHttpError(statusCode, bodyText))),
+ );
+ return;
+ }
+
+ const lengthHeader = response.headers["content-length"];
+ const total =
+ Number(
+ Array.isArray(lengthHeader) ? lengthHeader[0] : lengthHeader,
+ ) ||
+ Number(expectedSize) ||
+ undefined;
+
+ // "wx": the temp name is ours alone; refuse to reuse a stale one.
+ const writeStream = fs.createWriteStream(partialPath, { flags: "wx" });
+ let received = 0;
+
+ response.on("data", (chunk) => {
+ received += chunk.length;
+ const ok = writeStream.write(chunk);
+ if (!ok) {
+ response.pause();
+ writeStream.once("drain", () => response.resume());
+ }
+ report(received, total);
+ });
+ response.on("end", () => {
+ writeStream.end(() => {
+ report(received, total ?? received, true);
+ if (settled) return;
+ settled = true;
+ resolve();
+ });
+ });
+ response.on("error", (error) => {
+ writeStream.destroy();
+ fail(error);
+ });
+ writeStream.on("error", (error) => {
+ request.abort();
+ fail(error);
+ });
+ });
+
+ request.end(payload);
+ });
+
+ await prepareDownloadPath(destination.root, absDest);
+ await publishDownload(
+ partialPath,
+ absDest,
+ overwrite,
+ transferId,
+ publishFs || defaultPublishFs,
+ );
+ return { success: true, path: absDest };
+ } catch (error) {
+ await fsp.rm(partialPath, { force: true }).catch(() => {});
+ throw error;
+ } finally {
+ activeTransfers.delete(transferId);
+ activeDestinations.delete(absDest);
+ }
+}
+
+function wrap(handler) {
+ return async (event, ...args) => {
+ try {
+ const result = await handler(event, ...args);
+ return { success: true, ...(result || {}) };
+ } catch (error) {
+ return {
+ success: false,
+ error: error && error.message ? error.message : String(error),
+ code: error && error.code ? error.code : undefined,
+ };
+ }
+ };
+}
+
+// Builds the IPC handler map from injected dependencies so the whole boundary
+// can be exercised in tests with a Node http shim instead of Electron.
+function createLocalFileHandlers({
+ net,
+ shell,
+ getRemoteSyncConfig,
+ getRemoteSyncJwt,
+ localBaseUrl,
+ publishFs,
+}) {
+ if (!net || typeof net.request !== "function") {
+ throw new Error("createLocalFileHandlers requires a net implementation");
+ }
+ const resolveTransferTarget = createTargetResolver({
+ localBaseUrl,
+ getRemoteSyncConfig,
+ getRemoteSyncJwt,
+ });
+ const deps = {
+ net,
+ resolveTransferTarget,
+ publishFs: publishFs || defaultPublishFs,
+ };
+
+ return {
+ [IPC.HOME]: wrap(async () => ({
+ home: os.homedir(),
+ separator: path.sep,
+ platform: process.platform,
+ })),
+
+ [IPC.LIST]: wrap(async (_event, dirPath) => listDirectory(dirPath)),
+
+ [IPC.MKDIR]: wrap(async (_event, parentPath, name) => {
+ const parent = normalizeLocalPath(parentPath);
+ const safeName = requireEntryName(name, "folder name");
+ const target = path.join(parent, safeName);
+ await fsp.mkdir(target);
+ return { path: target };
+ }),
+
+ [IPC.CREATE_FILE]: wrap(async (_event, parentPath, name) => {
+ const parent = normalizeLocalPath(parentPath);
+ const safeName = requireEntryName(name, "file name");
+ const target = path.join(parent, safeName);
+ // "wx" fails if the file already exists rather than truncating it.
+ await fsp.writeFile(target, "", { flag: "wx" });
+ return { path: target };
+ }),
+
+ [IPC.RENAME]: wrap(async (_event, oldPath, newName) => {
+ const source = normalizeLocalPath(oldPath);
+ const safeName = requireEntryName(newName, "name");
+ const target = path.join(path.dirname(source), safeName);
+ if (target === source) return { path: source };
+ if (await pathExists(target)) {
+ throw new LocalFileError("EEXIST", `"${safeName}" already exists`);
+ }
+ await fsp.rename(source, target);
+ return { path: target };
+ }),
+
+ // Moves entries to the OS trash (Finder Trash / Recycle Bin) rather than
+ // deleting outright, so a mis-click in the file manager is recoverable.
+ [IPC.TRASH]: wrap(async (_event, targetPaths) => {
+ if (!Array.isArray(targetPaths) || targetPaths.length === 0) {
+ throw new Error("No local paths provided");
+ }
+ const failed = [];
+ for (const candidate of targetPaths) {
+ const target = normalizeLocalPath(candidate);
+ try {
+ await shell.trashItem(target);
+ } catch (error) {
+ failed.push({
+ path: target,
+ error: error && error.message ? error.message : String(error),
+ });
+ }
+ }
+ return { trashed: targetPaths.length - failed.length, failed };
+ }),
+
+ [IPC.ENSURE_DIR]: wrap(async (_event, dirPath, rootPath) => {
+ let target = normalizeLocalPath(dirPath);
+ // Transfers pass the folder the user picked; the directory skeleton of
+ // a downloaded tree must stay inside it.
+ if (rootPath !== undefined) {
+ target = (await prepareDownloadPath(rootPath, target, true)).path;
+ } else {
+ await fsp.mkdir(target, { recursive: true });
+ }
+ return { path: target };
+ }),
+
+ // Which of the given paths already exist; lets the renderer ask about
+ // collisions before a batch download starts.
+ [IPC.EXISTS]: wrap(async (_event, targetPaths) => {
+ if (!Array.isArray(targetPaths)) {
+ throw new Error("Expected a list of paths");
+ }
+ const existing = [];
+ for (const candidate of targetPaths) {
+ const target = normalizeLocalPath(candidate);
+ if (await pathExists(target)) existing.push(target);
+ }
+ return { existing };
+ }),
+
+ [IPC.WALK]: wrap(async (_event, rootPaths) => {
+ if (!Array.isArray(rootPaths) || rootPaths.length === 0) {
+ throw new Error("No local paths provided");
+ }
+ return walkPaths(rootPaths);
+ }),
+
+ [IPC.REVEAL]: wrap(async (_event, targetPath) => {
+ shell.showItemInFolder(normalizeLocalPath(targetPath));
+ }),
+
+ [IPC.OPEN]: wrap(async (_event, targetPath) => {
+ const error = await shell.openPath(normalizeLocalPath(targetPath));
+ if (error) throw new Error(error);
+ }),
+
+ [IPC.UPLOAD]: wrap((event, options) =>
+ uploadLocalFile(deps, event, options),
+ ),
+
+ [IPC.DOWNLOAD]: wrap((event, options) =>
+ downloadToLocal(deps, event, options),
+ ),
+
+ [IPC.CANCEL]: wrap(async (_event, transferId) => {
+ const state = activeTransfers.get(transferId);
+ if (!state) return { cancelled: false };
+ state.abort();
+ return { cancelled: true };
+ }),
+ };
+}
+
+function registerLocalFileHandlers({ ipcMain, shell }) {
+ // Real Electron wiring; tests build the handlers directly instead.
+ const { net } = require("electron");
+ const remoteSync = require("./remote-sync.cjs");
+ const handlers = createLocalFileHandlers({
+ net,
+ shell,
+ getRemoteSyncConfig: remoteSync.getRemoteSyncConfig,
+ getRemoteSyncJwt: remoteSync.getRemoteSyncJwt,
+ });
+ for (const [channel, handler] of Object.entries(handlers)) {
+ ipcMain.handle(channel, handler);
+ }
+}
+
+module.exports = {
+ IPC,
+ TRANSFER_ROUTES,
+ registerLocalFileHandlers,
+ // exported for tests / reuse
+ createLocalFileHandlers,
+ createTargetResolver,
+ publishDownload,
+ defaultPublishFs,
+ assertWithinRoot,
+ walkPaths,
+ listDirectory,
+};
diff --git a/electron/main.cjs b/electron/main.cjs
index bd23c2551..6123889f9 100644
--- a/electron/main.cjs
+++ b/electron/main.cjs
@@ -13,7 +13,9 @@ const {
} = require("electron");
const path = require("path");
const { getUnpackedAppRoot } = require("./backend-paths.cjs");
+const { classifyBackendFailure } = require("./backend-failure.cjs");
const fs = require("fs");
+const { renameLocalPath } = require("./rename-local-path.cjs");
const os = require("os");
const https = require("https");
const http = require("http");
@@ -21,7 +23,7 @@ const net = require("net");
const tls = require("tls");
const zlib = require("zlib");
const crypto = require("crypto");
-const { URL } = require("url");
+const { URL, pathToFileURL } = require("url");
const { fork, spawn } = require("child_process");
const pty = require("node-pty");
const WebSocket = require("ws");
@@ -31,6 +33,7 @@ const { isCloseActiveTabInput } = require("./keyboard-shortcuts.cjs");
const { quitApp } = require("./app-quit.cjs");
const { selectLinuxPasswordStore } = require("./linux-password-store.cjs");
const { resolveLocalShell } = require("./local-shell.cjs");
+const { registerLocalFileHandlers } = require("./local-files.cjs");
const localTerminalSessions = new Map();
@@ -536,6 +539,16 @@ function httpFetch(url, options = {}) {
// Node's http/https modules never auto-decompress, so an unhandled
// content-encoding here silently turns the body into garbage bytes.
let stream = res;
+ const maxResponseBytes = options.maxResponseBytes || 10 * 1024 * 1024;
+ let responseBytes = 0;
+ let settled = false;
+ const fail = (error) => {
+ if (settled) return;
+ settled = true;
+ stream.destroy();
+ req.destroy();
+ reject(error);
+ };
const encoding = (res.headers["content-encoding"] || "")
.toLowerCase()
.trim();
@@ -552,8 +565,17 @@ function httpFetch(url, options = {}) {
return;
}
- stream.on("data", (chunk) => chunks.push(chunk));
+ stream.on("data", (chunk) => {
+ responseBytes += chunk.length;
+ if (responseBytes > maxResponseBytes) {
+ fail(new Error(`Response exceeds ${maxResponseBytes} bytes`));
+ return;
+ }
+ chunks.push(chunk);
+ });
stream.on("end", () => {
+ if (settled) return;
+ settled = true;
const data = Buffer.concat(chunks).toString("utf8");
resolve({
ok: res.statusCode >= 200 && res.statusCode < 300,
@@ -562,7 +584,7 @@ function httpFetch(url, options = {}) {
json: () => Promise.resolve(JSON.parse(data)),
});
});
- stream.on("error", reject);
+ stream.on("error", fail);
});
req.on("error", reject);
@@ -596,7 +618,7 @@ if (process.platform === "linux") {
}
}
-if (process.platform === "win32") {
+if (process.platform === "win32" || process.env.ELECTRON_DISABLE_GPU === "1") {
app.disableHardwareAcceleration();
}
@@ -611,8 +633,28 @@ if (isInsecureModeEnabled()) {
app.commandLine.appendSwitch("--enable-features=NetworkService");
let mainWindow = null;
+const { createWebEndpointWindows } = require("./web-endpoint-window.cjs");
+const webEndpointWindows = createWebEndpointWindows({
+ BrowserWindow,
+ session,
+ getMainWindow: () => mainWindow,
+});
+ipcMain.handle("open-isolated-web-endpoint", (event, options) =>
+ webEndpointWindows.open(event, options),
+);
let backendProcess = null;
let backendStartFailed = false;
+// Why the embedded backend died, once it has. Null while it is healthy
+// or still starting. The renderer polls this to tell "still booting"
+// (keep waiting) apart from "never coming back" (show the reason).
+let backendFailure = null;
+// Set while we are deliberately tearing the backend down on quit, so a
+// SIGKILL we sent ourselves is not reported to the user as a crash.
+let backendStopRequested = false;
+// Tail of the embedded backend's stderr, kept only so a failed start can be
+// classified after the fact.
+const BACKEND_STDERR_TAIL_LIMIT = 8192;
+let backendStderrTail = "";
let tray = null;
let isQuitting = false;
const tempFiles = new Map();
@@ -726,9 +768,84 @@ function openPathWithEditor(filePath, editorPath) {
});
}
+// Origins the renderer has explicitly marked as allowed to present an invalid
+// certificate, for web endpoints whose ignoreCert is set. Session scoped and
+// never persisted.
+//
+// Deliberately NOT wired into isInvalidCertificateAllowedForUrl: that function
+// also governs this process's own outbound TLS via getTlsVerificationOptions,
+// and widening it would grant more privilege than the feature needs.
+//
+// Entries expire rather than living until the app restarts (days, on a
+// desktop app). Main has no host-database access, so it cannot verify a
+// renderer's claim that an origin really is a configured web endpoint -- an
+// unbounded allowance would make that an indefinite window rather than a
+// momentary one. The renderer re-registers before each load, which refreshes
+// the expiry, so a live endpoint keeps working while a stale entry lapses.
+const WEB_ENDPOINT_CERTIFICATE_ALLOWLIST_TTL_MS = 5 * 60 * 1000;
+const webEndpointCertificateAllowlist = new Map();
+
+function isWebEndpointCertificateAllowed(url) {
+ try {
+ const parsed = new URL(url);
+ // The allowance exists solely to suppress a TLS certificate error, so a
+ // non-https origin in the map is meaningless at best.
+ if (parsed.protocol !== "https:") return false;
+
+ const expiresAt = webEndpointCertificateAllowlist.get(parsed.origin);
+ if (expiresAt === undefined) return false;
+ if (Date.now() >= expiresAt) {
+ webEndpointCertificateAllowlist.delete(parsed.origin);
+ return false;
+ }
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+ipcMain.handle("allow-invalid-certificate-for-origin", (_event, origin) => {
+ try {
+ // Store the PARSED origin, never the caller's string, so a path or a
+ // wildcard cannot widen the allowance.
+ const parsed = new URL(String(origin));
+ if (parsed.protocol !== "https:") {
+ return { success: false };
+ }
+ webEndpointCertificateAllowlist.set(
+ parsed.origin,
+ Date.now() + WEB_ENDPOINT_CERTIFICATE_ALLOWLIST_TTL_MS,
+ );
+ return { success: true };
+ } catch {
+ return { success: false };
+ }
+});
+
app.on(
"certificate-error",
(event, _webContents, url, error, certificate, callback) => {
+ if (
+ webEndpointWindows.handleCertificateError(
+ event,
+ _webContents,
+ url,
+ callback,
+ )
+ )
+ return;
+ if (isWebEndpointCertificateAllowed(url)) {
+ event.preventDefault();
+ logToFile("Allowed invalid certificate for configured web endpoint", {
+ url,
+ error,
+ issuer: certificate?.issuerName,
+ subject: certificate?.subjectName,
+ });
+ callback(true);
+ return;
+ }
+
if (isInvalidCertificateAllowedForUrl(url)) {
event.preventDefault();
logToFile("Allowed invalid certificate for configured server", {
@@ -955,6 +1072,9 @@ function reapOrphanedBackendProcess() {
function startBackendServer() {
reapOrphanedBackendProcess();
+ backendFailure = null;
+ backendStopRequested = false;
+ backendStderrTail = "";
return new Promise((resolve) => {
const { entryPath, backendCwd } = getBackendPaths();
@@ -964,6 +1084,7 @@ function startBackendServer() {
if (!fs.existsSync(entryPath)) {
logToFile("Backend entry not found:", entryPath);
+ backendFailure = { reason: "crashed", port: null };
resolve(false);
return;
}
@@ -1022,8 +1143,16 @@ function startBackendServer() {
}
});
+ // The reason for a failed start is only ever visible in what the child
+ // wrote to stderr before dying, so keep a bounded tail of it. Bounded
+ // because a backend that stays up for days can otherwise log without
+ // limit into a buffer nothing ever drains.
backendProcess.stderr.on("data", (data) => {
- logToFile("[backend:stderr]", data.toString().trim());
+ const chunk = data.toString();
+ backendStderrTail = (backendStderrTail + chunk).slice(
+ -BACKEND_STDERR_TAIL_LIMIT,
+ );
+ logToFile("[backend:stderr]", chunk.trim());
});
backendProcess.on("exit", (code, signal) => {
@@ -1031,6 +1160,16 @@ function startBackendServer() {
if (!resolved && code !== 0) {
backendStartFailed = true;
}
+ // Classified whether or not the ready promise already settled: the
+ // 15s ready timeout resolves optimistically, so a backend that dies
+ // at second 20 still has to be reported rather than silently dropped.
+ // backendStopRequested is the only evidence that an exit was asked
+ // for, so it is the sole guard here -- past it, every exit means the
+ // backend is gone and the renderer must stop waiting for it.
+ if (!backendStopRequested) {
+ backendFailure = classifyBackendFailure(backendStderrTail);
+ logToFile("Backend failure classified as:", backendFailure.reason);
+ }
backendProcess = null;
clearBackendPidFile();
if (!resolved) {
@@ -1042,6 +1181,7 @@ function startBackendServer() {
backendProcess.on("error", (err) => {
logToFile("Failed to start backend process:", err.message);
+ backendFailure = { reason: "crashed", port: null };
backendProcess = null;
if (!resolved) {
resolved = true;
@@ -1064,6 +1204,7 @@ function stopBackendServer() {
if (!backendProcess) return;
console.log("Stopping embedded backend server...");
+ backendStopRequested = true;
try {
backendProcess.send({ type: "shutdown" });
@@ -1193,11 +1334,12 @@ function createWindow() {
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
- webSecurity: false,
+ sandbox: true,
+ webSecurity: true,
preload: path.join(__dirname, "preload.js"),
partition: termixSessionPartition,
- allowRunningInsecureContent: true,
- webviewTag: true,
+ allowRunningInsecureContent: false,
+ webviewTag: false,
offscreen: false,
},
show: true,
@@ -1377,6 +1519,13 @@ function createWindow() {
}
return { action: "deny" };
});
+
+ mainWindow.webContents.on("will-navigate", (event, url) => {
+ const allowedUrl = isDev
+ ? url.startsWith("http://localhost:5173/")
+ : url === pathToFileURL(path.join(appRoot, "dist", "index.html")).href;
+ if (!allowedUrl) event.preventDefault();
+ });
}
ipcMain.handle("get-app-version", () => {
@@ -1500,6 +1649,10 @@ ipcMain.handle("get-embedded-server-status", () => {
return {
running:
backendProcess !== null && !backendProcess.killed && !backendStartFailed,
+ // A backend that is merely slow to boot reports no failure, so the
+ // renderer keeps waiting for it. Only a classified failure means the
+ // process is gone for good and waiting is pointless.
+ failure: backendFailure,
dataDir: isDev ? null : getBackendDataDir(),
};
});
@@ -1646,7 +1799,7 @@ ipcMain.handle("clear-remote-sync-config", async () => {
return result;
});
-ipcMain.handle("save-remote-sync-jwt", (_event, token) => {
+ipcMain.handle("save-remote-sync-jwt", async (_event, token) => {
const result = remoteSync.saveRemoteSyncJwt(token);
if (result.success) {
remoteSync.getRemoteSyncEngine()?.updateStatus({
@@ -1654,7 +1807,8 @@ ipcMain.handle("save-remote-sync-jwt", (_event, token) => {
needsReauth: false,
lastError: null,
});
- remoteSync.getRemoteSyncEngine()?.syncNow();
+ const status = await remoteSync.getRemoteSyncEngine()?.syncNow();
+ return { ...result, status: status || null };
}
return result;
});
@@ -1716,6 +1870,7 @@ ipcMain.handle("save-c2s-tunnel-config", async (_event, config) => {
if (mode === "remote") {
const sourceHostId = Number(tunnel.sourceHostId);
const sourcePort = Number(tunnel.sourcePort);
+ const remoteAddress = getC2SRemoteAddress(tunnel);
if (
!Number.isInteger(sourceHostId) ||
sourceHostId < 1 ||
@@ -1728,7 +1883,7 @@ ipcMain.handle("save-c2s-tunnel-config", async (_event, config) => {
error: "Invalid remote client tunnel endpoint or port",
};
}
- const listenerKey = `${sourceHostId}:${sourcePort}`;
+ const listenerKey = `${sourceHostId}:${remoteAddress}:${sourcePort}`;
if (autoStartRemoteListeners.has(listenerKey)) {
return {
success: false,
@@ -1739,7 +1894,7 @@ ipcMain.handle("save-c2s-tunnel-config", async (_event, config) => {
continue;
}
- const bindHost = tunnel.bindHost || "127.0.0.1";
+ const bindHost = getC2SLocalAddress(tunnel);
const sourcePort = Number(tunnel.sourcePort);
const listenerKey = `${bindHost}:${sourcePort}`;
if (autoStartListeners.has(listenerKey)) {
@@ -1751,7 +1906,9 @@ ipcMain.handle("save-c2s-tunnel-config", async (_event, config) => {
autoStartListeners.add(listenerKey);
}
for (const listenerKey of autoStartListeners) {
- const [bindHost, sourcePort] = listenerKey.split(":");
+ const sourcePortSeparator = listenerKey.lastIndexOf(":");
+ const bindHost = listenerKey.slice(0, sourcePortSeparator);
+ const sourcePort = listenerKey.slice(sourcePortSeparator + 1);
const result = await checkLocalPortAvailable(
bindHost,
Number(sourcePort),
@@ -1814,6 +1971,34 @@ function checkTcpConnection(host, port) {
});
}
+function getC2SAddress(value, fallback) {
+ const address = typeof value === "string" ? value.trim() : "";
+ return address || fallback;
+}
+
+function getC2SLocalAddress(tunnel) {
+ return getC2SAddress(tunnel?.localAddress || tunnel?.bindHost, "127.0.0.1");
+}
+
+function getC2SRemoteAddress(tunnel) {
+ return getC2SAddress(
+ tunnel?.remoteAddress || tunnel?.targetHost,
+ "127.0.0.1",
+ );
+}
+
+function normalizeC2STunnelAddresses(tunnel) {
+ const localAddress = getC2SLocalAddress(tunnel);
+ const remoteAddress = getC2SRemoteAddress(tunnel);
+ return {
+ ...tunnel,
+ localAddress,
+ remoteAddress,
+ bindHost: localAddress,
+ targetHost: remoteAddress,
+ };
+}
+
const c2sTunnelRuntimes = new Map();
const C2S_WS_HIGH_WATERMARK = 1024 * 1024;
const C2S_WS_LOW_WATERMARK = 256 * 1024;
@@ -1840,23 +2025,147 @@ function getC2SRelayUrl() {
return relayHttpUrl.replace(/^http:/, "ws:").replace(/^https:/, "wss:");
}
-async function getC2SRelayHeaders() {
- const jwt = remoteSync.getRemoteSyncJwt();
- if (!jwt) return {};
+function getC2SRemoteBaseUrl() {
+ const config = remoteSync.getRemoteSyncConfig();
+ const serverUrl = config?.serverUrl;
+ if (!serverUrl) {
+ throw new Error(
+ "No remote Termix server connected -- enable Remote Sync first",
+ );
+ }
+ return serverUrl.replace(/\/$/, "");
+}
+
+const C2S_REMOTE_SESSION_EXPIRED_ERROR =
+ "Remote Termix session expired. Reconnect Remote Sync and try again.";
+
+function normalizeC2SAuthToken(authToken) {
+ return typeof authToken === "string" ? authToken.trim() : "";
+}
+
+function isC2SAuthError(message) {
+ const value = String(message || "")
+ .trim()
+ .toLowerCase();
+ return (
+ value === "authentication required" ||
+ value === "missing authentication token" ||
+ value === "invalid token" ||
+ value === "session expired" ||
+ value === "session not found"
+ );
+}
+
+function normalizeC2SErrorMessage(message, fallback = "Client tunnel failed") {
+ const value = message || fallback;
+ return isC2SAuthError(value) ? C2S_REMOTE_SESSION_EXPIRED_ERROR : value;
+}
+
+function createC2SFailure(message, fallback) {
+ const error = normalizeC2SErrorMessage(message, fallback);
+ return {
+ success: false,
+ error,
+ ...(error === C2S_REMOTE_SESSION_EXPIRED_ERROR
+ ? { code: "REMOTE_SESSION_EXPIRED" }
+ : {}),
+ };
+}
+
+async function fetchC2SRemoteJson(pathname) {
+ const remoteSyncJwt = remoteSync.getRemoteSyncJwt();
+ if (!remoteSyncJwt || remoteSync.isJwtExpiredOrExpiringSoon(remoteSyncJwt)) {
+ throw new Error(C2S_REMOTE_SESSION_EXPIRED_ERROR);
+ }
+
+ const url = `${getC2SRemoteBaseUrl()}${pathname}`;
+ const response = await fetch(url, {
+ headers: {
+ Authorization: `Bearer ${remoteSyncJwt}`,
+ "X-Electron-App": "true",
+ },
+ });
+ if (response.status === 401 || response.status === 403) {
+ throw new Error(C2S_REMOTE_SESSION_EXPIRED_ERROR);
+ }
+ if (!response.ok) {
+ throw new Error(`Request failed (${response.status}): ${url}`);
+ }
+ return response.json();
+}
+
+async function resolveC2SRemoteSourceHost(tunnel) {
+ const normalized = normalizeC2STunnelAddresses(tunnel);
+ const sourceHostSyncId =
+ typeof normalized.sourceHostSyncId === "string"
+ ? normalized.sourceHostSyncId.trim()
+ : "";
+ if (!sourceHostSyncId) return normalized;
+
+ const data = await fetchC2SRemoteJson("/sync/hosts");
+ const remoteHost = (Array.isArray(data?.rows) ? data.rows : []).find(
+ (row) => row?.syncId === sourceHostSyncId,
+ );
+ const remoteHostId = Number(remoteHost?.id);
+ if (!Number.isInteger(remoteHostId) || remoteHostId < 1) {
+ throw new Error(
+ "Intermediate Host is not available on the remote Termix server yet. Run Remote Sync for hosts, then try again.",
+ );
+ }
return {
- Authorization: `Bearer ${jwt}`,
+ ...normalized,
+ sourceHostId: remoteHostId,
+ sourceHostSyncId,
+ sourceHostName: remoteHost.name || normalized.sourceHostName,
+ endpointHost: normalized.endpointHost || remoteHost.name,
};
}
+async function getC2SRelayHeaders(relayUrl) {
+ const headers = { "X-Electron-App": "true" };
+
+ const remoteSyncJwt = remoteSync.getRemoteSyncJwt();
+ if (remoteSyncJwt && !remoteSync.isJwtExpiredOrExpiringSoon(remoteSyncJwt)) {
+ headers.Authorization = `Bearer ${remoteSyncJwt}`;
+ return headers;
+ }
+
+ if (remoteSyncJwt) {
+ throw new Error(C2S_REMOTE_SESSION_EXPIRED_ERROR);
+ }
+
+ if (!mainWindow?.webContents?.session) {
+ throw new Error(C2S_REMOTE_SESSION_EXPIRED_ERROR);
+ }
+
+ const cookieUrl = relayUrl
+ .replace(/^ws:/, "http:")
+ .replace(/^wss:/, "https:");
+ const cookies = await mainWindow.webContents.session.cookies.get({
+ url: cookieUrl,
+ name: "jwt",
+ });
+ const jwt = cookies[0]?.value;
+ if (!jwt) {
+ throw new Error(C2S_REMOTE_SESSION_EXPIRED_ERROR);
+ }
+
+ headers.Cookie = `jwt=${encodeURIComponent(jwt)}`;
+ return headers;
+}
+
function getC2STunnelName(tunnel, index = 0) {
if (tunnel.name) return tunnel.name;
+ const localAddress = getC2SLocalAddress(tunnel);
+ const remoteAddress = getC2SRemoteAddress(tunnel);
return [
"c2s",
index,
tunnel.sourceHostId || 0,
tunnel.mode || tunnel.tunnelType || "local",
- tunnel.bindHost || "127.0.0.1",
+ localAddress,
+ remoteAddress,
tunnel.sourcePort,
tunnel.endpointPort || 0,
].join("::");
@@ -1942,10 +2251,12 @@ async function openC2SRelay(
targetPort,
socket,
initialData,
+ authToken,
) {
+ const tunnelConfig = normalizeC2STunnelAddresses(tunnel);
const tunnelName = tunnel.name || getC2STunnelName(tunnel);
const relayUrl = getC2SRelayUrl();
- const headers = await getC2SRelayHeaders();
+ const headers = await getC2SRelayHeaders(relayUrl, authToken);
logToFile(`[c2s] opening relay for ${tunnelName}`, {
relayUrl,
targetHost,
@@ -2004,7 +2315,7 @@ async function openC2SRelay(
ws.send(
JSON.stringify({
type: "open",
- tunnelConfig: tunnel,
+ tunnelConfig,
targetHost,
targetPort,
}),
@@ -2033,11 +2344,12 @@ async function openC2SRelay(
ws.send(pendingChunks.shift());
}
} else if (message.type === "error") {
- logToFile("[c2s] relay error:", message.error);
- setC2STunnelError(
- tunnelName,
- message.error || "Relay rejected the client tunnel",
+ const relayError = normalizeC2SErrorMessage(
+ message.error,
+ "Relay rejected the client tunnel",
);
+ logToFile("[c2s] relay error:", relayError);
+ setC2STunnelError(tunnelName, relayError);
cleanup();
}
} catch (error) {
@@ -2048,9 +2360,10 @@ async function openC2SRelay(
});
}
-async function testC2SRelay(tunnel, targetHost, targetPort) {
+async function testC2SRelay(tunnel, targetHost, targetPort, authToken) {
+ const tunnelConfig = normalizeC2STunnelAddresses(tunnel);
const relayUrl = getC2SRelayUrl();
- const headers = await getC2SRelayHeaders();
+ const headers = await getC2SRelayHeaders(relayUrl, authToken);
const ws = new WebSocket(
relayUrl,
getWebSocketOptions(relayUrl, { headers }),
@@ -2077,7 +2390,7 @@ async function testC2SRelay(tunnel, targetHost, targetPort) {
ws.send(
JSON.stringify({
type: "test",
- tunnelConfig: tunnel,
+ tunnelConfig,
targetHost,
targetPort,
}),
@@ -2093,19 +2406,16 @@ async function testC2SRelay(tunnel, targetHost, targetPort) {
settle({ success: true });
} else if (message.type === "error") {
clearTimeout(timer);
- settle({
- success: false,
- error: message.error || "Tunnel test failed",
- });
+ settle(createC2SFailure(message.error, "Tunnel test failed"));
}
} catch (error) {
clearTimeout(timer);
- settle({ success: false, error: error.message });
+ settle(createC2SFailure(error.message, "Tunnel test failed"));
}
});
ws.on("error", (error) => {
clearTimeout(timer);
- settle({ success: false, error: error.message });
+ settle(createC2SFailure(error.message, "Tunnel test failed"));
});
ws.on("close", () => {
clearTimeout(timer);
@@ -2114,64 +2424,67 @@ async function testC2SRelay(tunnel, targetHost, targetPort) {
});
}
-async function testC2STunnel(tunnel, index = 0) {
- const mode = tunnel.mode || tunnel.tunnelType || "local";
+async function testC2STunnel(tunnel, index = 0, authToken) {
+ const resolvedTunnel = await resolveC2SRemoteSourceHost(tunnel);
+ const mode = resolvedTunnel.mode || resolvedTunnel.tunnelType || "local";
const testTunnel = {
- ...tunnel,
- name: `${getC2STunnelName(tunnel, index)}::test`,
+ ...normalizeC2STunnelAddresses(resolvedTunnel),
+ name: `${getC2STunnelName(resolvedTunnel, index)}::test`,
mode,
};
- const bindHost = tunnel.bindHost || "127.0.0.1";
- const sourcePort = Number(tunnel.sourcePort);
- const endpointPort = Number(tunnel.endpointPort);
+ const localAddress = getC2SLocalAddress(testTunnel);
+ const remoteAddress = getC2SRemoteAddress(testTunnel);
+ const sourcePort = Number(resolvedTunnel.sourcePort);
+ const endpointPort = Number(resolvedTunnel.endpointPort);
- if (!tunnel.sourceHostId) {
+ if (!resolvedTunnel.sourceHostId) {
return { success: false, error: "Endpoint SSH host is required" };
}
if (mode === "remote") {
- const localTarget = await checkTcpConnection(bindHost, endpointPort);
+ const localTarget = await checkTcpConnection(localAddress, endpointPort);
if (!localTarget.success) {
return {
success: false,
- error: `Local target ${bindHost}:${endpointPort} is not reachable: ${localTarget.error}`,
+ error: `Local target ${localAddress}:${endpointPort} is not reachable: ${localTarget.error}`,
};
}
- return testC2SRelay(testTunnel, undefined, undefined);
+ return testC2SRelay(testTunnel, undefined, undefined, authToken);
}
if (!Number.isInteger(sourcePort) || sourcePort < 1 || sourcePort > 65535) {
return { success: false, error: "Invalid local port" };
}
- const runtime = c2sTunnelRuntimes.get(getC2STunnelName(tunnel, index));
+ const runtime = c2sTunnelRuntimes.get(
+ getC2STunnelName(resolvedTunnel, index),
+ );
if (!runtime) {
- const availability = await checkLocalPortAvailable(bindHost, sourcePort);
+ const availability = await checkLocalPortAvailable(
+ localAddress,
+ sourcePort,
+ );
if (!availability.available) {
return {
success: false,
- error: `Local listener ${bindHost}:${sourcePort} is not available: ${availability.error}`,
+ error: `Local listener ${localAddress}:${sourcePort} is not available: ${availability.error}`,
};
}
}
if (mode === "dynamic") {
- return testC2SRelay(testTunnel, undefined, undefined);
+ return testC2SRelay(testTunnel, undefined, undefined, authToken);
}
if (!Number.isInteger(endpointPort) || endpointPort < 1) {
return { success: false, error: "Invalid remote port" };
}
- return testC2SRelay(
- testTunnel,
- tunnel.targetHost || "127.0.0.1",
- endpointPort,
- );
+ return testC2SRelay(testTunnel, remoteAddress, endpointPort, authToken);
}
-function handleC2SDynamicConnection(tunnel, socket) {
+function handleC2SDynamicConnection(tunnel, socket, authToken) {
const tunnelName = tunnel.name || getC2STunnelName(tunnel);
let buffer = Buffer.alloc(0);
let stage = "greeting";
@@ -2209,12 +2522,21 @@ function handleC2SDynamicConnection(tunnel, socket) {
socket.off("data", onData);
const remainder = buffer.subarray(target.bytesRead);
socket.write(Buffer.from([0x05, 0x00, 0x00, 0x01, 0, 0, 0, 0, 0, 0]));
- openC2SRelay(tunnel, target.host, target.port, socket, remainder).catch(
- (error) => {
- logToFile("[c2s] dynamic relay failed:", error.message);
- fail(0x05, error.message || "Dynamic relay failed");
- },
- );
+ openC2SRelay(
+ tunnel,
+ target.host,
+ target.port,
+ socket,
+ remainder,
+ authToken,
+ ).catch((error) => {
+ const message = normalizeC2SErrorMessage(
+ error.message,
+ "Dynamic relay failed",
+ );
+ logToFile("[c2s] dynamic relay failed:", message);
+ fail(0x05, message);
+ });
}
} catch (error) {
logToFile("[c2s] SOCKS5 parse failed:", error.message);
@@ -2226,13 +2548,24 @@ function handleC2SDynamicConnection(tunnel, socket) {
socket.on("error", () => socket.destroy());
}
-function handleC2SLocalConnection(tunnel, socket) {
+function handleC2SLocalConnection(tunnel, socket, authToken) {
const tunnelName = tunnel.name || getC2STunnelName(tunnel);
- const targetHost = tunnel.targetHost || "127.0.0.1";
+ const targetHost = getC2SRemoteAddress(tunnel);
const targetPort = Number(tunnel.endpointPort);
- openC2SRelay(tunnel, targetHost, targetPort, socket).catch((error) => {
- logToFile("[c2s] local relay failed:", error.message);
- setC2STunnelError(tunnelName, error.message || "Local relay failed");
+ openC2SRelay(
+ tunnel,
+ targetHost,
+ targetPort,
+ socket,
+ undefined,
+ authToken,
+ ).catch((error) => {
+ const message = normalizeC2SErrorMessage(
+ error.message,
+ "Local relay failed",
+ );
+ logToFile("[c2s] local relay failed:", message);
+ setC2STunnelError(tunnelName, message);
socket.destroy();
});
}
@@ -2286,9 +2619,11 @@ function writeC2SRemoteChunk(target, chunk, ws, closeTarget) {
}
}
-async function startC2SRemoteTunnel(tunnel, index = 0) {
+async function startC2SRemoteTunnel(tunnel, index = 0, authToken) {
const tunnelName = getC2STunnelName(tunnel, index);
- const localHost = tunnel.bindHost || "127.0.0.1";
+ const tunnelConfig = normalizeC2STunnelAddresses(tunnel);
+ const localHost = getC2SLocalAddress(tunnelConfig);
+ const remoteHost = getC2SRemoteAddress(tunnelConfig);
const localPort = Number(tunnel.endpointPort);
const remotePort = Number(tunnel.sourcePort);
@@ -2319,17 +2654,18 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
if (
runtime.mode === "remote" &&
runtime.sourceHostId === Number(tunnel.sourceHostId) &&
+ runtime.remoteAddress === remoteHost &&
runtime.sourcePort === remotePort
) {
return {
success: false,
- error: `Another client remote tunnel already uses ${remotePort} on this endpoint`,
+ error: `Another client remote tunnel already uses ${remoteHost}:${remotePort} on this endpoint`,
};
}
}
const relayUrl = getC2SRelayUrl();
- const headers = await getC2SRelayHeaders();
+ const headers = await getC2SRelayHeaders(relayUrl, authToken);
const ws = new WebSocket(
relayUrl,
getWebSocketOptions(relayUrl, { headers }),
@@ -2358,6 +2694,7 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
sourceHostId: Number(tunnel.sourceHostId),
sourcePort: remotePort,
bindHost: localHost,
+ remoteAddress: remoteHost,
status: { connected: false, status: "CONNECTING" },
close: cleanup,
});
@@ -2374,6 +2711,7 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
ws.on("open", () => {
logToFile(`[c2s] opening remote tunnel ${tunnelName}`, {
relayUrl,
+ remoteHost,
remotePort,
localHost,
localPort,
@@ -2381,7 +2719,7 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
ws.send(
JSON.stringify({
type: "open",
- tunnelConfig: { ...tunnel, name: tunnelName, mode: "remote" },
+ tunnelConfig: { ...tunnelConfig, name: tunnelName, mode: "remote" },
}),
);
});
@@ -2393,9 +2731,13 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
try {
message = JSON.parse(data.toString());
} catch (error) {
- setC2STunnelError(tunnelName, error.message || "Invalid relay message");
+ const message = normalizeC2SErrorMessage(
+ error.message,
+ "Invalid relay message",
+ );
+ setC2STunnelError(tunnelName, message);
cleanup();
- settle({ success: false, error: error.message });
+ settle(createC2SFailure(message, "Invalid relay message"));
return;
}
@@ -2409,12 +2751,15 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
}
if (message.type === "error") {
- const error = message.error || "Relay rejected the client tunnel";
+ const error = normalizeC2SErrorMessage(
+ message.error,
+ "Relay rejected the client tunnel",
+ );
setC2STunnelError(tunnelName, error);
cleanup();
c2sTunnelRuntimes.delete(tunnelName);
emitC2STunnelStatuses();
- settle({ success: false, error });
+ settle(createC2SFailure(error, "Relay rejected the client tunnel"));
return;
}
@@ -2496,32 +2841,40 @@ async function startC2SRemoteTunnel(tunnel, index = 0) {
});
ws.on("error", (error) => {
- setC2STunnelError(tunnelName, error.message || "Relay connection failed");
+ const message = normalizeC2SErrorMessage(
+ error.message,
+ "Relay connection failed",
+ );
+ setC2STunnelError(tunnelName, message);
cleanup();
c2sTunnelRuntimes.delete(tunnelName);
emitC2STunnelStatuses();
- settle({ success: false, error: error.message });
+ settle(createC2SFailure(message, "Relay connection failed"));
});
});
}
-async function startC2STunnel(tunnel, index = 0) {
- const mode = tunnel.mode || tunnel.tunnelType || "local";
- const tunnelName = getC2STunnelName(tunnel, index);
- const bindHost = tunnel.bindHost || "127.0.0.1";
- const sourcePort = Number(tunnel.sourcePort);
+async function startC2STunnel(tunnel, index = 0, authToken) {
+ const resolvedTunnel = await resolveC2SRemoteSourceHost(tunnel);
+ const mode = resolvedTunnel.mode || resolvedTunnel.tunnelType || "local";
+ const tunnelName = getC2STunnelName(resolvedTunnel, index);
+ const tunnelConfig = normalizeC2STunnelAddresses(resolvedTunnel);
+ const bindHost = getC2SLocalAddress(tunnelConfig);
+ const sourcePort = Number(resolvedTunnel.sourcePort);
logToFile(`[c2s] starting tunnel ${tunnelName}`, {
mode,
bindHost,
+ remoteAddress: getC2SRemoteAddress(tunnelConfig),
sourcePort,
- sourceHostId: tunnel.sourceHostId,
- endpointPort: tunnel.endpointPort,
+ sourceHostId: resolvedTunnel.sourceHostId,
+ sourceHostSyncId: resolvedTunnel.sourceHostSyncId,
+ endpointPort: resolvedTunnel.endpointPort,
});
if (mode === "remote") {
- return startC2SRemoteTunnel(tunnel, index);
+ return startC2SRemoteTunnel(resolvedTunnel, index, authToken);
}
- if (!tunnel.sourceHostId) {
+ if (!resolvedTunnel.sourceHostId) {
return { success: false, error: "Endpoint SSH host is required" };
}
if (!Number.isInteger(sourcePort) || sourcePort < 1 || sourcePort > 65535) {
@@ -2559,9 +2912,17 @@ async function startC2STunnel(tunnel, index = 0) {
sockets.add(socket);
socket.on("close", () => sockets.delete(socket));
if (mode === "dynamic") {
- handleC2SDynamicConnection({ ...tunnel, name: tunnelName, mode }, socket);
+ handleC2SDynamicConnection(
+ { ...tunnelConfig, name: tunnelName, mode },
+ socket,
+ authToken,
+ );
} else {
- handleC2SLocalConnection({ ...tunnel, name: tunnelName, mode }, socket);
+ handleC2SLocalConnection(
+ { ...tunnelConfig, name: tunnelName, mode },
+ socket,
+ authToken,
+ );
}
});
@@ -2711,19 +3072,27 @@ ipcMain.handle("check-local-port-available", async (_event, host, port) => {
return checkLocalPortAvailable(host, sourcePort);
});
-ipcMain.handle("start-c2s-tunnel", async (_event, tunnel, index) => {
+ipcMain.handle("start-c2s-tunnel", async (_event, tunnel, index, authToken) => {
try {
- return await startC2STunnel(tunnel, Number(index) || 0);
+ return await startC2STunnel(
+ tunnel,
+ Number(index) || 0,
+ normalizeC2SAuthToken(authToken),
+ );
} catch (error) {
- return { success: false, error: error.message };
+ return createC2SFailure(error.message, "Failed to start client tunnel");
}
});
-ipcMain.handle("test-c2s-tunnel", async (_event, tunnel, index) => {
+ipcMain.handle("test-c2s-tunnel", async (_event, tunnel, index, authToken) => {
try {
- return await testC2STunnel(tunnel, Number(index) || 0);
+ return await testC2STunnel(
+ tunnel,
+ Number(index) || 0,
+ normalizeC2SAuthToken(authToken),
+ );
} catch (error) {
- return { success: false, error: error.message };
+ return createC2SFailure(error.message, "Failed to test client tunnel");
}
});
@@ -3006,6 +3375,255 @@ ipcMain.handle("show-open-dialog", async (_event, options) => {
return dialog.showOpenDialog(mainWindow, options || {});
});
+function toLocalFileType(stat) {
+ if (stat.isDirectory()) return "directory";
+ if (stat.isFile()) return "file";
+ if (stat.isSymbolicLink()) return "link";
+ return "other";
+}
+
+function getLocalEntry(entryPath, name = path.basename(entryPath)) {
+ const stat = fs.lstatSync(entryPath);
+ return {
+ name,
+ path: entryPath,
+ type: toLocalFileType(stat),
+ size: stat.isFile() ? stat.size : 0,
+ created: stat.birthtime.toISOString(),
+ modified: stat.mtime.toISOString(),
+ modifiedTimestamp: stat.mtimeMs,
+ hidden: name.startsWith("."),
+ permissions: (stat.mode & 0o777).toString(8).padStart(3, "0"),
+ owner: String(stat.uid),
+ group: String(stat.gid),
+ };
+}
+
+function normalizeRelativeLocalPath(relativePath) {
+ return relativePath.split(path.sep).join("/");
+}
+
+function validateLocalName(name) {
+ if (typeof name !== "string" || !name.trim()) {
+ throw new Error("Missing name");
+ }
+ const trimmed = name.trim();
+ if (
+ trimmed.includes("/") ||
+ trimmed.includes("\\") ||
+ trimmed === "." ||
+ trimmed === ".."
+ ) {
+ throw new Error("Name cannot contain path separators");
+ }
+ return trimmed;
+}
+
+function ensureLocalDirectory(dirPath) {
+ if (typeof dirPath !== "string" || !dirPath) {
+ throw new Error("Missing directory path");
+ }
+ const stat = fs.statSync(dirPath);
+ if (!stat.isDirectory()) {
+ throw new Error("Path is not a directory");
+ }
+}
+
+function collectLocalFilesFromPath(rootPath, rootName, files, limit) {
+ if (files.length >= limit) return;
+
+ const stat = fs.lstatSync(rootPath);
+ if (stat.isSymbolicLink()) return;
+
+ if (stat.isFile()) {
+ files.push({
+ path: rootPath,
+ name: path.basename(rootPath),
+ relativePath: normalizeRelativeLocalPath(rootName),
+ size: stat.size,
+ created: stat.birthtime.toISOString(),
+ modified: stat.mtime.toISOString(),
+ });
+ return;
+ }
+
+ if (!stat.isDirectory()) return;
+
+ for (const childName of fs.readdirSync(rootPath)) {
+ if (files.length >= limit) return;
+ const childPath = path.join(rootPath, childName);
+ collectLocalFilesFromPath(
+ childPath,
+ path.join(rootName, childName),
+ files,
+ limit,
+ );
+ }
+}
+
+ipcMain.handle("get-local-home-directory", () => os.homedir());
+
+ipcMain.handle("list-local-directory", (_event, dirPath) => {
+ try {
+ const requestedPath =
+ typeof dirPath === "string" && dirPath.trim() ? dirPath : os.homedir();
+ const stat = fs.statSync(requestedPath);
+ if (!stat.isDirectory()) {
+ return {
+ success: false,
+ path: requestedPath,
+ entries: [],
+ error: "Path is not a directory",
+ };
+ }
+
+ const entries = fs
+ .readdirSync(requestedPath, { withFileTypes: true })
+ .map((entry) => {
+ try {
+ return getLocalEntry(
+ path.join(requestedPath, entry.name),
+ entry.name,
+ );
+ } catch {
+ return null;
+ }
+ })
+ .filter(Boolean)
+ .sort((a, b) => {
+ if (a.type === "directory" && b.type !== "directory") return -1;
+ if (a.type !== "directory" && b.type === "directory") return 1;
+ return a.name.localeCompare(b.name);
+ });
+
+ return {
+ success: true,
+ path: requestedPath,
+ parent: path.dirname(requestedPath),
+ entries,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ path: typeof dirPath === "string" ? dirPath : "",
+ entries: [],
+ error: error instanceof Error ? error.message : "Failed to list path",
+ };
+ }
+});
+
+ipcMain.handle("stat-local-paths", (_event, paths) => {
+ const pathList = Array.isArray(paths) ? paths : [];
+ return pathList.map((entryPath) => {
+ try {
+ return { success: true, ...getLocalEntry(entryPath) };
+ } catch (error) {
+ return {
+ success: false,
+ path: entryPath,
+ error: error instanceof Error ? error.message : "Failed to stat path",
+ };
+ }
+ });
+});
+
+ipcMain.handle("collect-local-files", (_event, paths) => {
+ try {
+ const pathList = Array.isArray(paths) ? paths : [];
+ const files = [];
+ const limit = 10000;
+
+ for (const entryPath of pathList) {
+ if (typeof entryPath !== "string" || !entryPath) continue;
+ collectLocalFilesFromPath(
+ entryPath,
+ path.basename(entryPath),
+ files,
+ limit + 1,
+ );
+ if (files.length > limit) break;
+ }
+
+ return {
+ success: true,
+ files: files.slice(0, limit),
+ truncated: files.length > limit,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ files: [],
+ error: error instanceof Error ? error.message : "Failed to collect files",
+ };
+ }
+});
+
+ipcMain.handle("create-local-folder", (_event, parentPath, folderName) => {
+ try {
+ ensureLocalDirectory(parentPath);
+ const safeName = validateLocalName(folderName);
+ const targetPath = path.join(parentPath, safeName);
+ fs.mkdirSync(targetPath);
+ return { success: true, ...getLocalEntry(targetPath, safeName) };
+ } catch (error) {
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : "Failed to create folder",
+ };
+ }
+});
+
+ipcMain.handle("rename-local-path", (_event, entryPath, newName) => {
+ try {
+ if (typeof entryPath !== "string" || !entryPath) {
+ throw new Error("Missing path");
+ }
+ const safeName = validateLocalName(newName);
+ const targetPath = path.join(path.dirname(entryPath), safeName);
+ renameLocalPath(entryPath, targetPath);
+ return { success: true, ...getLocalEntry(targetPath, safeName) };
+ } catch (error) {
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : "Failed to rename path",
+ };
+ }
+});
+
+ipcMain.handle("trash-local-path", async (_event, entryPath) => {
+ try {
+ if (typeof entryPath !== "string" || !entryPath) {
+ throw new Error("Missing path");
+ }
+ await shell.trashItem(entryPath);
+ return { success: true };
+ } catch (error) {
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : "Failed to delete path",
+ };
+ }
+});
+
+ipcMain.handle("chmod-local-path", (_event, entryPath, permissions) => {
+ try {
+ if (typeof entryPath !== "string" || !entryPath) {
+ throw new Error("Missing path");
+ }
+ if (typeof permissions !== "string" || !/^[0-7]{3,4}$/.test(permissions)) {
+ throw new Error("Permissions must be an octal value");
+ }
+ fs.chmodSync(entryPath, parseInt(permissions, 8));
+ return { success: true, ...getLocalEntry(entryPath) };
+ } catch (error) {
+ return {
+ success: false,
+ error:
+ error instanceof Error ? error.message : "Failed to update permissions",
+ };
+ }
+});
+
ipcMain.handle("create-temp-file", async (_event, fileData) => {
try {
const result = createManagedTempFile(
@@ -3205,6 +3823,10 @@ async function testServerConnection(
ipcMain.handle("test-server-connection", testServerConnection);
+// Local disk browsing + streamed local<->remote transfers for the file
+// manager's dual-pane mode (see electron/local-files.cjs).
+registerLocalFileHandlers({ ipcMain, shell });
+
function createMenu() {
if (process.platform === "darwin") {
const template = [
diff --git a/electron/preload.js b/electron/preload.js
index b045cf651..26893db95 100644
--- a/electron/preload.js
+++ b/electron/preload.js
@@ -1,8 +1,36 @@
const { contextBridge, ipcRenderer } = require("electron");
+const ALLOWED_INVOKE_CHANNELS = new Set([
+ "check-electron-update",
+ "clear-remote-sync-config",
+ "get-desktop-settings",
+ "get-legacy-server-config",
+ "get-remote-sync-config",
+ "get-remote-sync-jwt",
+ "get-remote-sync-status",
+ "get-remote-sync-user-info",
+ "notify-local-login",
+ "remote-sync-now",
+ "save-desktop-settings",
+ "save-remote-sync-config",
+ "save-remote-sync-jwt",
+ "test-server-connection",
+ "allow-invalid-certificate-for-origin",
+ "open-isolated-web-endpoint",
+]);
+
+function invokeAllowed(channel, ...args) {
+ if (!ALLOWED_INVOKE_CHANNELS.has(channel)) {
+ return Promise.reject(new Error(`IPC channel is not allowed: ${channel}`));
+ }
+ return ipcRenderer.invoke(channel, ...args);
+}
+
contextBridge.exposeInMainWorld("electronAPI", {
getAppVersion: () => ipcRenderer.invoke("get-app-version"),
getPlatform: () => ipcRenderer.invoke("get-platform"),
+ getEmbeddedServerStatus: () =>
+ ipcRenderer.invoke("get-embedded-server-status"),
openNativeRdp: (options) => ipcRenderer.invoke("open-native-rdp", options),
removeAllListeners: (channel) => ipcRenderer.removeAllListeners(channel),
@@ -18,10 +46,10 @@ contextBridge.exposeInMainWorld("electronAPI", {
ipcRenderer.invoke("check-local-port-available", host, port),
getC2STunnelPresetDefaultName: () =>
ipcRenderer.invoke("get-c2s-tunnel-preset-default-name"),
- startC2STunnel: (tunnel, index) =>
- ipcRenderer.invoke("start-c2s-tunnel", tunnel, index),
- testC2STunnel: (tunnel, index) =>
- ipcRenderer.invoke("test-c2s-tunnel", tunnel, index),
+ startC2STunnel: (tunnel, index, authToken) =>
+ ipcRenderer.invoke("start-c2s-tunnel", tunnel, index, authToken),
+ testC2STunnel: (tunnel, index, authToken) =>
+ ipcRenderer.invoke("test-c2s-tunnel", tunnel, index, authToken),
stopC2STunnel: (tunnelName) =>
ipcRenderer.invoke("stop-c2s-tunnel", tunnelName),
getC2STunnelStatuses: () => ipcRenderer.invoke("get-c2s-tunnel-statuses"),
@@ -72,6 +100,20 @@ contextBridge.exposeInMainWorld("electronAPI", {
showSaveDialog: (options) => ipcRenderer.invoke("show-save-dialog", options),
showOpenDialog: (options) => ipcRenderer.invoke("show-open-dialog", options),
+ getLocalHomeDirectory: () => ipcRenderer.invoke("get-local-home-directory"),
+ listLocalDirectory: (dirPath) =>
+ ipcRenderer.invoke("list-local-directory", dirPath),
+ statLocalPaths: (paths) => ipcRenderer.invoke("stat-local-paths", paths),
+ collectLocalFiles: (paths) =>
+ ipcRenderer.invoke("collect-local-files", paths),
+ createLocalFolder: (parentPath, folderName) =>
+ ipcRenderer.invoke("create-local-folder", parentPath, folderName),
+ renameLocalPath: (entryPath, newName) =>
+ ipcRenderer.invoke("rename-local-path", entryPath, newName),
+ trashLocalPath: (entryPath) =>
+ ipcRenderer.invoke("trash-local-path", entryPath),
+ chmodLocalPath: (entryPath, permissions) =>
+ ipcRenderer.invoke("chmod-local-path", entryPath, permissions),
createTempFile: (fileData) =>
ipcRenderer.invoke("create-temp-file", fileData),
createTempFolder: (folderData) =>
@@ -103,7 +145,39 @@ contextBridge.exposeInMainWorld("electronAPI", {
return () => ipcRenderer.removeListener(channel, listener);
},
- invoke: (channel, ...args) => ipcRenderer.invoke(channel, ...args),
+ // Dual-pane file manager: local disk browsing and streamed transfers.
+ localFs: {
+ home: () => ipcRenderer.invoke("local-fs:home"),
+ list: (dirPath) => ipcRenderer.invoke("local-fs:list", dirPath),
+ mkdir: (parentPath, name) =>
+ ipcRenderer.invoke("local-fs:mkdir", parentPath, name),
+ createFile: (parentPath, name) =>
+ ipcRenderer.invoke("local-fs:create-file", parentPath, name),
+ rename: (oldPath, newName) =>
+ ipcRenderer.invoke("local-fs:rename", oldPath, newName),
+ trash: (paths) => ipcRenderer.invoke("local-fs:trash", paths),
+ ensureDir: (dirPath, rootPath) =>
+ ipcRenderer.invoke("local-fs:ensure-dir", dirPath, rootPath),
+ exists: (paths) => ipcRenderer.invoke("local-fs:exists", paths),
+ walk: (paths) => ipcRenderer.invoke("local-fs:walk", paths),
+ reveal: (targetPath) => ipcRenderer.invoke("local-fs:reveal", targetPath),
+ open: (targetPath) => ipcRenderer.invoke("local-fs:open", targetPath),
+ },
+ localTransfer: {
+ upload: (options) => ipcRenderer.invoke("local-transfer:upload", options),
+ download: (options) =>
+ ipcRenderer.invoke("local-transfer:download", options),
+ cancel: (transferId) =>
+ ipcRenderer.invoke("local-transfer:cancel", transferId),
+ onProgress: (callback) => {
+ const listener = (_event, payload) => callback(payload);
+ ipcRenderer.on("local-transfer:progress", listener);
+ return () =>
+ ipcRenderer.removeListener("local-transfer:progress", listener);
+ },
+ },
+
+ invoke: invokeAllowed,
});
contextBridge.exposeInMainWorld("electronClipboard", {
diff --git a/electron/remote-sync-fetch.cjs b/electron/remote-sync-fetch.cjs
new file mode 100644
index 000000000..7d6c7cd70
--- /dev/null
+++ b/electron/remote-sync-fetch.cjs
@@ -0,0 +1,27 @@
+const { Agent, fetch: undiciFetch } = require("undici");
+
+function createRemoteSyncFetch(getConfig) {
+ let invalidCertificateAgent;
+ return function fetchRemoteSync(url, options = {}) {
+ const config = getConfig();
+ const target = new URL(url);
+ const allowInvalidCertificate =
+ config?.allowInvalidCertificate === true &&
+ config.serverUrl &&
+ target.protocol === "https:" &&
+ target.origin === new URL(config.serverUrl).origin;
+ if (!allowInvalidCertificate) return fetch(url, options);
+
+ invalidCertificateAgent ??= new Agent({
+ connect: { rejectUnauthorized: false },
+ });
+ return undiciFetch(url, {
+ ...options,
+ dispatcher: invalidCertificateAgent,
+ // A redirected request must not inherit the configured origin's TLS exception.
+ redirect: "error",
+ });
+ };
+}
+
+module.exports = { createRemoteSyncFetch };
diff --git a/electron/remote-sync.cjs b/electron/remote-sync.cjs
index 507c5120f..9ab431e36 100644
--- a/electron/remote-sync.cjs
+++ b/electron/remote-sync.cjs
@@ -14,8 +14,12 @@
const { app, safeStorage } = require("electron");
const fs = require("fs");
const path = require("path");
+const { orderSyncWrites } = require("./sync-write-order.cjs");
const { SYNCED_ENTITY_TYPES } = require("./remote-sync-entities.cjs");
+const { createRemoteSyncFetch } = require("./remote-sync-fetch.cjs");
+const fetchRemoteSync = createRemoteSyncFetch(getRemoteSyncConfig);
+
const SYNC_INTERVAL_MS = 90 * 1000;
const EMBEDDED_BASE_URL = "http://127.0.0.1:30001";
@@ -37,7 +41,20 @@ function writeJson(filePath, value) {
if (!fs.existsSync(userDataPath)) {
fs.mkdirSync(userDataPath, { recursive: true });
}
- fs.writeFileSync(filePath, JSON.stringify(value, null, 2));
+ const temporaryPath = `${filePath}.${process.pid}-${Date.now()}.tmp`;
+ try {
+ fs.writeFileSync(temporaryPath, JSON.stringify(value, null, 2), {
+ mode: 0o600,
+ });
+ fs.renameSync(temporaryPath, filePath);
+ } catch (error) {
+ try {
+ fs.unlinkSync(temporaryPath);
+ } catch {
+ // already absent
+ }
+ throw error;
+ }
}
function getDesktopSettingsPath() {
@@ -141,13 +158,13 @@ async function getRemoteSyncUserInfo() {
}
const baseUrl = config.serverUrl.replace(/\/$/, "");
- const userResponse = await fetch(`${baseUrl}/users/me`, {
+ const userResponse = await fetchRemoteSync(`${baseUrl}/users/me`, {
headers: { Authorization: `Bearer ${token}`, "X-Electron-App": "true" },
});
if (!userResponse.ok) return null;
const user = await userResponse.json();
- const rolesResponse = await fetch(
+ const rolesResponse = await fetchRemoteSync(
`${baseUrl}/rbac/users/${encodeURIComponent(user.userId)}/roles`,
{
headers: { Authorization: `Bearer ${token}`, "X-Electron-App": "true" },
@@ -191,6 +208,7 @@ class RemoteSyncEngine {
this.getMainWindow = getMainWindow;
this.localJwt = null;
this.timer = null;
+ this.startupTimer = null;
this.syncing = false;
this.status = {
connected: false,
@@ -220,11 +238,15 @@ class RemoteSyncEngine {
const config = getRemoteSyncConfig();
this.status.connected = !!config?.serverUrl;
if (this.timer) clearInterval(this.timer);
+ if (this.startupTimer) clearTimeout(this.startupTimer);
this.timer = setInterval(() => this.syncNow(), SYNC_INTERVAL_MS);
if (config?.serverUrl) {
// Fire an initial sync shortly after startup rather than waiting a
// full interval, but don't block app boot on it.
- setTimeout(() => this.syncNow(), 5000);
+ this.startupTimer = setTimeout(() => {
+ this.startupTimer = null;
+ this.syncNow();
+ }, 5000);
}
}
@@ -233,6 +255,10 @@ class RemoteSyncEngine {
clearInterval(this.timer);
this.timer = null;
}
+ if (this.startupTimer) {
+ clearTimeout(this.startupTimer);
+ this.startupTimer = null;
+ }
}
async syncNow() {
@@ -349,7 +375,7 @@ class RemoteSyncEngine {
}
async fetchJson(url, token, options = {}) {
- const res = await fetch(url, {
+ const res = await fetchRemoteSync(url, {
...options,
headers: {
"Content-Type": "application/json",
@@ -467,36 +493,33 @@ class RemoteSyncEngine {
...remoteBySyncId.keys(),
]);
+ const writes = [];
for (const syncId of allSyncIds) {
if (tombstonedSyncIds.has(syncId)) continue;
-
const localRow = localBySyncId.get(syncId);
const remoteRow = remoteBySyncId.get(syncId);
-
- if (localRow && !remoteRow) {
- await this.pushRow(remoteBaseUrl, remoteJwt, entityType, localRow);
- } else if (remoteRow && !localRow) {
- await this.pushRow(
- EMBEDDED_BASE_URL,
- this.localJwt,
- entityType,
- remoteRow,
- );
- } else if (localRow && remoteRow) {
- const localUpdatedAt = new Date(localRow.updatedAt || 0).getTime();
- const remoteUpdatedAt = new Date(remoteRow.updatedAt || 0).getTime();
- if (localUpdatedAt > remoteUpdatedAt) {
- await this.pushRow(remoteBaseUrl, remoteJwt, entityType, localRow);
- } else if (remoteUpdatedAt > localUpdatedAt) {
- await this.pushRow(
- EMBEDDED_BASE_URL,
- this.localJwt,
- entityType,
- remoteRow,
- );
- }
+ const localTime = new Date(localRow?.updatedAt || 0).getTime();
+ const remoteTime = new Date(remoteRow?.updatedAt || 0).getTime();
+ if (localRow && (!remoteRow || localTime > remoteTime)) {
+ writes.push({
+ baseUrl: remoteBaseUrl,
+ token: remoteJwt,
+ row: localRow,
+ });
+ } else if (remoteRow && (!localRow || remoteTime > localTime)) {
+ writes.push({
+ baseUrl: EMBEDDED_BASE_URL,
+ token: this.localJwt,
+ row: remoteRow,
+ });
}
}
+ for (const { baseUrl, token, row } of orderSyncWrites(
+ entityType,
+ writes,
+ )) {
+ await this.pushRow(baseUrl, token, entityType, row);
+ }
// Apply tombstones to whichever side hasn't already deleted the row.
//
diff --git a/electron/rename-local-path.cjs b/electron/rename-local-path.cjs
new file mode 100644
index 000000000..b989985ba
--- /dev/null
+++ b/electron/rename-local-path.cjs
@@ -0,0 +1,22 @@
+const fs = require("node:fs");
+
+function renameLocalPath(source, target) {
+ if (source === target) return;
+ try {
+ fs.lstatSync(target);
+ const error = new Error("A file or folder with that name already exists");
+ error.code = "EEXIST";
+ throw error;
+ } catch (error) {
+ if (error.code !== "ENOENT") throw error;
+ }
+ if (fs.lstatSync(source).isDirectory()) {
+ fs.renameSync(source, target);
+ return;
+ }
+ // link is exclusive: a destination created concurrently is never replaced.
+ fs.linkSync(source, target);
+ fs.unlinkSync(source);
+}
+
+module.exports = { renameLocalPath };
diff --git a/electron/sync-write-order.cjs b/electron/sync-write-order.cjs
new file mode 100644
index 000000000..dd075541e
--- /dev/null
+++ b/electron/sync-write-order.cjs
@@ -0,0 +1,31 @@
+// Sort writes per destination: response order is lost when both sides are merged.
+function orderSyncWrites(entityType, writes) {
+ if (entityType !== "hosts") return writes;
+ const destinations = new Map();
+ for (const write of writes) {
+ if (!destinations.has(write.baseUrl)) {
+ destinations.set(write.baseUrl, new Map());
+ }
+ destinations.get(write.baseUrl).set(write.row.syncId, write);
+ }
+ const ordered = [];
+ const visited = new Set();
+ const visiting = new Set();
+ const visit = (write) => {
+ if (visited.has(write)) return;
+ if (visiting.has(write))
+ throw new Error("Cyclic parent host sync dependency");
+ visiting.add(write);
+ const parent = destinations
+ .get(write.baseUrl)
+ .get(write.row.parentHostSyncId);
+ if (parent) visit(parent);
+ visiting.delete(write);
+ visited.add(write);
+ ordered.push(write);
+ };
+ writes.forEach(visit);
+ return ordered;
+}
+
+module.exports = { orderSyncWrites };
diff --git a/electron/web-endpoint-window.cjs b/electron/web-endpoint-window.cjs
new file mode 100644
index 000000000..ddc09813f
--- /dev/null
+++ b/electron/web-endpoint-window.cjs
@@ -0,0 +1,128 @@
+const { randomUUID } = require("node:crypto");
+
+function webUrl(value) {
+ const url = new URL(value);
+ if (
+ !["http:", "https:"].includes(url.protocol) ||
+ url.username ||
+ url.password
+ ) {
+ throw new Error(
+ "Web endpoints require an HTTP(S) URL without embedded credentials",
+ );
+ }
+ return url;
+}
+
+function createWebEndpointWindows({ BrowserWindow, session, getMainWindow }) {
+ const certificates = new WeakMap();
+ async function open(event, options = {}) {
+ const main = getMainWindow();
+ if (
+ !main ||
+ event.sender !== main.webContents ||
+ event.senderFrame !== main.webContents.mainFrame
+ ) {
+ throw new Error("Only the main Termix window can open web endpoints");
+ }
+ const url = webUrl(options.url);
+ const isolated = session.fromPartition(`web-endpoint-${randomUUID()}`, {
+ cache: false,
+ });
+ isolated.setPermissionRequestHandler((_contents, _permission, callback) =>
+ callback(false),
+ );
+ isolated.setPermissionCheckHandler(() => false);
+ isolated.on("will-download", (event) => event.preventDefault());
+ isolated.webRequest.onBeforeRequest((details, callback) => {
+ const protocol = new URL(details.url).protocol;
+ callback({
+ cancel: !["http:", "https:", "ws:", "wss:"].includes(protocol),
+ });
+ });
+ const preferences = {
+ session: isolated,
+ sandbox: true,
+ contextIsolation: true,
+ nodeIntegration: false,
+ webviewTag: false,
+ webSecurity: true,
+ };
+ const windows = new Set();
+ const allowedCertificateOrigin =
+ options.ignoreCert === true ? url.origin : null;
+ const configure = (win) => {
+ windows.add(win);
+ certificates.set(win.webContents, allowedCertificateOrigin);
+ win.setMenu(null);
+ const canNavigate = (target) => {
+ try {
+ return target === "about:blank" || !!webUrl(target);
+ } catch {
+ return false;
+ }
+ };
+ for (const name of ["will-navigate", "will-redirect"]) {
+ win.webContents.on(name, (event, target) => {
+ if (!canNavigate(target)) event.preventDefault();
+ });
+ }
+ win.webContents.setWindowOpenHandler(({ url: target }) =>
+ canNavigate(target)
+ ? {
+ action: "allow",
+ overrideBrowserWindowOptions: { webPreferences: preferences },
+ }
+ : { action: "deny" },
+ );
+ win.webContents.on("did-create-window", configure);
+ win.on("closed", () => {
+ windows.delete(win);
+ if (windows.size === 0) {
+ void Promise.allSettled([
+ isolated.clearStorageData(),
+ isolated.clearCache(),
+ isolated.closeAllConnections(),
+ ]);
+ }
+ });
+ };
+ const win = new BrowserWindow({
+ width: 1100,
+ height: 800,
+ title: `Web endpoint — ${url.hostname}`,
+ webPreferences: preferences,
+ });
+ configure(win);
+ const close = () => {
+ for (const child of [...windows])
+ if (!child.isDestroyed()) child.destroy();
+ };
+ main.once("closed", close);
+ win.once("closed", () => {
+ main.removeListener("closed", close);
+ close();
+ });
+ try {
+ await win.loadURL(url.href);
+ } catch (error) {
+ close();
+ throw error;
+ }
+ return { success: true };
+ }
+ function handleCertificateError(event, contents, url, callback) {
+ if (!certificates.has(contents)) return false;
+ event.preventDefault();
+ let allowed = false;
+ try {
+ allowed = certificates.get(contents) === new URL(url).origin;
+ } catch {
+ /* malformed URL is refused */
+ }
+ callback(allowed);
+ return true;
+ }
+ return { open, handleCertificateError };
+}
+module.exports = { createWebEndpointWindows, webUrl };
diff --git a/index.html b/index.html
index f3f0c8fd9..9de5da6e8 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,7 @@
/>
+
-
diff --git a/package-lock.json b/package-lock.json
index 5519ea084..32f8a0c08 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,23 +1,23 @@
{
"name": "termix",
- "version": "2.7.1",
+ "version": "2.8.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "termix",
- "version": "2.7.1",
+ "version": "2.8.0",
"hasInstallScript": true,
"dependencies": {
"@anthropic-ai/sdk": "^0.120.0",
"@simplewebauthn/browser": "^13.3.0",
"@simplewebauthn/server": "^13.3.2",
- "@tanstack/react-virtual": "^3.14.9",
+ "@tanstack/react-virtual": "^3.14.10",
"@types/compression": "^1.8.1",
"@types/ldapjs": "^3.0.6",
"axios": "^1.19.0",
"bcryptjs": "^3.0.3",
- "better-sqlite3": "^13.0.2",
+ "better-sqlite3": "^13.0.3",
"body-parser": "^2.3.0",
"chalk": "^6.0.0",
"compression": "^1.8.1",
@@ -27,33 +27,34 @@
"drizzle-orm": "^0.45.2",
"express": "^5.2.1",
"guacamole-lite": "^1.2.0",
- "jose": "^6.2.8",
- "js-yaml": "^5.3.0",
+ "jose": "^6.2.9",
+ "js-yaml": "^5.2.3",
"jsonwebtoken": "^9.0.3",
"jszip": "^3.10.1",
"ldapjs": "^3.0.7",
- "motion": "^12.43.0",
- "multer": "^2.2.0",
- "mysql2": "^3.23.2",
+ "motion": "^13.1.1",
+ "multer": "^2.3.0",
+ "mysql2": "^3.23.4",
"nanoid": "^6.0.1",
"node-pty": "^1.1.0",
"pg": "^8.23.0",
"qrcode": "^1.5.4",
+ "redis": "^6.2.1",
"serialport": "^13.0.0",
- "sharp": "^0.35.3",
+ "sharp": "^0.35.4",
"socks": "^2.8.7",
"speakeasy": "^2.0.0",
"ssh2": "^1.17.0",
"undici": "^8.10.0",
- "ws": "^8.21.1"
+ "ws": "^8.21.3"
},
"devDependencies": {
"@codemirror/autocomplete": "^6.20.3",
"@codemirror/commands": "^6.11.0",
"@codemirror/search": "^6.7.1",
"@codemirror/theme-one-dark": "^6.1.3",
- "@codemirror/view": "^6.43.7",
- "@commitlint/cli": "^21.2.1",
+ "@codemirror/view": "^6.43.9",
+ "@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.0",
"@deadendjs/swagger-jsdoc": "^8.1.2",
"@electron/notarize": "^3.1.1",
@@ -82,9 +83,9 @@
"@radix-ui/react-tooltip": "^1.2.16",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/dom": "^10.4.1",
- "@testing-library/jest-dom": "^7.0.0",
+ "@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.2",
- "@testing-library/user-event": "^14.6.1",
+ "@testing-library/user-event": "^14.6.5",
"@types/better-sqlite3": "^9.6.0",
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
@@ -104,9 +105,9 @@
"@uiw/codemirror-extensions-langs": "^4.25.11",
"@uiw/codemirror-theme-github": "^4.25.11",
"@uiw/react-codemirror": "^4.25.11",
- "@vitejs/plugin-react": "^6.1.0",
- "@vitest/coverage-v8": "^4.1.10",
- "@vitest/ui": "^4.1.10",
+ "@vitejs/plugin-react": "^6.0.5",
+ "@vitest/coverage-v8": "^4.1.11",
+ "@vitest/ui": "^4.1.11",
"@xterm/addon-clipboard": "^0.2.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-search": "^0.16.0",
@@ -116,14 +117,14 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
- "concurrently": "^10.0.4",
- "cytoscape": "^3.34.0",
+ "concurrently": "^10.0.5",
+ "cytoscape": "^3.34.1",
"drizzle-kit": "^0.31.10",
"electron": "^43.4.1",
"electron-builder": "^26.15.3",
- "eslint": "^10.8.0",
+ "eslint": "^10.8.1",
"eslint-plugin-react-hooks": "^7.1.1",
- "eslint-plugin-react-refresh": "^0.5.3",
+ "eslint-plugin-react-refresh": "^0.5.4",
"eslint-plugin-unused-imports": "^4.4.1",
"globals": "^17.11.0",
"guacamole-common-js": "^1.5.0",
@@ -139,8 +140,8 @@
"react-cytoscapejs": "^2.0.0",
"react-dom": "^19.2.8",
"react-h5-audio-player": "^3.10.2",
- "react-hook-form": "^7.85.0",
- "react-i18next": "^17.0.11",
+ "react-hook-form": "^7.84.0",
+ "react-i18next": "^17.0.12",
"react-icons": "^5.7.0",
"react-markdown": "^10.1.0",
"react-pdf": "^10.5.0",
@@ -148,15 +149,15 @@
"react-syntax-highlighter": "^16.1.1",
"react-xtermjs": "^1.0.10",
"remark-gfm": "^4.0.1",
- "sonner": "^2.0.7",
+ "sonner": "^2.0.8",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.4",
"tw-animate-css": "^1.4.0",
"typescript": "~6.0.3",
- "typescript-eslint": "^8.67.0",
- "vite": "^8.2.0",
+ "typescript-eslint": "^8.66.0",
+ "vite": "^8.2.2",
"vite-plugin-svgr": "^5.2.0",
- "vitest": "^4.1.10"
+ "vitest": "^4.1.11"
},
"engines": {
"node": ">=22.12.0",
@@ -209,9 +210,9 @@
}
},
"node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -996,9 +997,9 @@
}
},
"node_modules/@codemirror/view": {
- "version": "6.43.7",
- "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.7.tgz",
- "integrity": "sha512-FZsExxkoxnAN+d9TgqXLg5g4A1oQwzX9WlkOT5i2PKkcW7xx3Bmu0vs90g6fo9Mpdsb/l96dnAraQ8932aO4/g==",
+ "version": "6.43.9",
+ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.9.tgz",
+ "integrity": "sha512-sTuUzTpPMFebRhg6dawChoKKgndIwfjmJgKVxBefPElcU2NwQ6AFroupk0SFqEerQyZOGRfDNnSN8Dw/lMAsXw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1009,16 +1010,16 @@
}
},
"node_modules/@commitlint/cli": {
- "version": "21.2.1",
- "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-21.2.1.tgz",
- "integrity": "sha512-blsZGe29hJ72VGEFVl72IVYX+1vsfINpjA9yWQA6i7OKD/McGEOXg08sKIRKjFk4JvzhV/9n0l3i6NooPLTNfg==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-21.2.2.tgz",
+ "integrity": "sha512-a+6hQxIxnpdvSvS2apvttPNbEliYsVC3PqFYDiiB2kjbwIsQsj1urvQ4Tkf70pKYozPalKAuRQmm/GHwndduqA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@commitlint/config-conventional": "^21.2.0",
- "@commitlint/format": "^21.2.0",
- "@commitlint/lint": "^21.2.0",
- "@commitlint/load": "^21.2.0",
+ "@commitlint/config-conventional": "^21.2.2",
+ "@commitlint/format": "^21.2.2",
+ "@commitlint/lint": "^21.2.2",
+ "@commitlint/load": "^21.2.2",
"@commitlint/read": "^21.2.1",
"@commitlint/types": "^21.2.0",
"tinyexec": "^1.0.0",
@@ -1131,9 +1132,9 @@
}
},
"node_modules/@commitlint/config-conventional": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-21.2.0.tgz",
- "integrity": "sha512-Qf8WRDVcyVd14if6VTWenebxFbKnVnbzPUJjlzjkyJGeHK2xCGd63Dr1XZzj0plXKQb9P0BfOxoc1HVeCo2BWQ==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-21.2.2.tgz",
+ "integrity": "sha512-NxA37SZviusFUEYOQZ5hNnZ1h7O/KiemPkxjOlpzKJNnWxThiwc6/SaZhaPa8fyLvfRBAywhQhJJk8XESHWlpQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1183,9 +1184,9 @@
}
},
"node_modules/@commitlint/format": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-21.2.0.tgz",
- "integrity": "sha512-c4q64xaav2U83t7k7RyzJerBZurPer7FxUOY0RL5L/6CZijZ7K+s6HIBGIghj0ey1P2+seRX0J9XQYtDued6tg==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-21.2.2.tgz",
+ "integrity": "sha512-v6fvxZSc/AvVMROlr3H34+1766bZSYApRUSCAMjWamStPjKMvZ8GdvVA5YW/VQNgbFTmcMz6OYmSTJEvIjPrfA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1197,9 +1198,9 @@
}
},
"node_modules/@commitlint/is-ignored": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-21.2.0.tgz",
- "integrity": "sha512-4/eB0vBN7L88O/oC4ajAEqi7j2ZfNgxl/+11RfAV9YosejZgDXhY2C9VcHnHJhOzPLoSy5P3Mg/46kqeyJfXKw==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-21.2.2.tgz",
+ "integrity": "sha512-9UoKNgfFE3LU7FrzierCvk3CdDfMDeVGC86qZiT/n0TIjfq/dmZ9MHuXd45OTNRa26ZanmJRxEtmiXk/lEJihg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1211,15 +1212,15 @@
}
},
"node_modules/@commitlint/lint": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-21.2.0.tgz",
- "integrity": "sha512-ceO5dp9pLjEZ6y6qbq/uXWXDPykqqlTsyzoQ0NzecpisSJhK3kTy9qzQoPeJuWG/IMNdV1lO0RgmzqoAlSi1uw==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-21.2.2.tgz",
+ "integrity": "sha512-Fy8JxEBzdmsYWFude/61GxXu5O+wEymwiRK2z9GL9R8mCsXphCoGxAFc5iHn5mjlfcSrhiiONE+ksf4KOjnaPg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@commitlint/is-ignored": "^21.2.0",
- "@commitlint/parse": "^21.2.0",
- "@commitlint/rules": "^21.2.0",
+ "@commitlint/is-ignored": "^21.2.2",
+ "@commitlint/parse": "^21.2.2",
+ "@commitlint/rules": "^21.2.2",
"@commitlint/types": "^21.2.0"
},
"engines": {
@@ -1227,15 +1228,15 @@
}
},
"node_modules/@commitlint/load": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-21.2.0.tgz",
- "integrity": "sha512-RjlzWQqruRwIenJEfZtq7kG97co97nKoHpflE5YnF61tDLXxHPrdWImgzw6VL6MlFyaOcVlk74eBV8ZQmc3oIA==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-21.2.2.tgz",
+ "integrity": "sha512-0Tt6wDPX167cjKC5D4zhm0+20wJJG+TN/TKovMOspfSe78rOnKX+MNzlVNiu6HyQPZChPJ8QBH31MVt6Bb8fCg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@commitlint/config-validator": "^21.2.0",
"@commitlint/execute-rule": "^21.0.1",
- "@commitlint/resolve-extends": "^21.2.0",
+ "@commitlint/resolve-extends": "^21.2.2",
"@commitlint/types": "^21.2.0",
"cosmiconfig": "^9.0.1",
"cosmiconfig-typescript-loader": "^6.1.0",
@@ -1258,9 +1259,9 @@
}
},
"node_modules/@commitlint/parse": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-21.2.0.tgz",
- "integrity": "sha512-QHWxG4d0PLTF634/AdyZ0MQS+CLn5YOuJlCFhMMlSGKFxzYGUetkHBj18xgBD+6fVzUrA2lrCdi/vlS2f/oYXg==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-21.2.2.tgz",
+ "integrity": "sha512-MEkobPfvRp+z06Wro8HMG1BDGHzZmj82A1LH1nWeG3ipHpg/x4m6v3wEDvMBIKjRFUnfR3nBeFs3MVCr7UdAmg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1289,9 +1290,9 @@
}
},
"node_modules/@commitlint/resolve-extends": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-21.2.0.tgz",
- "integrity": "sha512-4O/1j51+79Wth9s/MGxt/5gs0XYLDgNlYpltQfhAvLE0itusLKs9zruxbiNg1oOkmkb9L9L4USYGjEj7n87NxA==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-21.2.2.tgz",
+ "integrity": "sha512-RPkJ/IFi7sMUUVbZLqwWFtWw/zRDcfFsmrPSiTMrt5wb7AdxOr86EGQFvmGzef5QKV5IPBWWCujqVTw1RWX44A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1306,9 +1307,9 @@
}
},
"node_modules/@commitlint/rules": {
- "version": "21.2.0",
- "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-21.2.0.tgz",
- "integrity": "sha512-C2yXMNpiB8ETZKfx5JD8+ExgF8vTU1VQMKPSUUYwqKpw9oJWQBrlXBpdU038mj2WPjof7o9UzFpmTyBeGMZwZg==",
+ "version": "21.2.2",
+ "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-21.2.2.tgz",
+ "integrity": "sha512-eplQzyYkBjYB1HyyRj8hkcK11Y9DU9nuBz7uOKEd6NpE9NGDytLFCAnlRE+OoiK/5sHEJsaz2RGhuWBvYzIbNA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1386,9 +1387,9 @@
}
},
"node_modules/@conventional-changelog/template": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@conventional-changelog/template/-/template-1.2.1.tgz",
- "integrity": "sha512-TzlTVpKPjaqW6qOYjQcYUDuGsLCNsvFHVBXkYGTAnf5V37jCWrE5haKNXzz0WZUtVHjrpV76L1buANjwXMfT8w==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@conventional-changelog/template/-/template-1.4.0.tgz",
+ "integrity": "sha512-aalGyl7dbB5PArRebDIX43ZvBlXrYm9uWzGJ26t+4SzJVPsOuvfILGGbw5X4yX7i50YEmJ8zvbiWnqH/AAnZqg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1860,6 +1861,16 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/@emnapi/runtime": {
+ "version": "1.11.3",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
+ "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
"node_modules/@esbuild-kit/core-utils": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz",
@@ -2646,9 +2657,9 @@
}
},
"node_modules/@img/sharp-darwin-arm64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz",
- "integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.4.tgz",
+ "integrity": "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA==",
"cpu": [
"arm64"
],
@@ -2664,13 +2675,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-darwin-arm64": "1.3.2"
+ "@img/sharp-libvips-darwin-arm64": "1.3.3"
}
},
"node_modules/@img/sharp-darwin-x64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz",
- "integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.4.tgz",
+ "integrity": "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw==",
"cpu": [
"x64"
],
@@ -2686,20 +2697,20 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-darwin-x64": "1.3.2"
+ "@img/sharp-libvips-darwin-x64": "1.3.3"
}
},
"node_modules/@img/sharp-freebsd-wasm32": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz",
- "integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.4.tgz",
+ "integrity": "sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA==",
"license": "Apache-2.0",
"optional": true,
"os": [
"freebsd"
],
"dependencies": {
- "@img/sharp-wasm32": "0.35.3"
+ "@img/sharp-wasm32": "0.35.4"
},
"engines": {
"node": ">=20.9.0"
@@ -2709,9 +2720,9 @@
}
},
"node_modules/@img/sharp-libvips-darwin-arm64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz",
- "integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.3.tgz",
+ "integrity": "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg==",
"cpu": [
"arm64"
],
@@ -2725,9 +2736,9 @@
}
},
"node_modules/@img/sharp-libvips-darwin-x64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz",
- "integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.3.tgz",
+ "integrity": "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw==",
"cpu": [
"x64"
],
@@ -2741,9 +2752,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-arm": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz",
- "integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.3.tgz",
+ "integrity": "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA==",
"cpu": [
"arm"
],
@@ -2757,9 +2768,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-arm64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz",
- "integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.3.tgz",
+ "integrity": "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A==",
"cpu": [
"arm64"
],
@@ -2773,9 +2784,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-ppc64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz",
- "integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.3.tgz",
+ "integrity": "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w==",
"cpu": [
"ppc64"
],
@@ -2789,9 +2800,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-riscv64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz",
- "integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.3.tgz",
+ "integrity": "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ==",
"cpu": [
"riscv64"
],
@@ -2805,9 +2816,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-s390x": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz",
- "integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.3.tgz",
+ "integrity": "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q==",
"cpu": [
"s390x"
],
@@ -2821,9 +2832,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-x64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz",
- "integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.3.tgz",
+ "integrity": "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA==",
"cpu": [
"x64"
],
@@ -2837,9 +2848,9 @@
}
},
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz",
- "integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.3.tgz",
+ "integrity": "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw==",
"cpu": [
"arm64"
],
@@ -2853,9 +2864,9 @@
}
},
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz",
- "integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.3.tgz",
+ "integrity": "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw==",
"cpu": [
"x64"
],
@@ -2869,9 +2880,9 @@
}
},
"node_modules/@img/sharp-linux-arm": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz",
- "integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.4.tgz",
+ "integrity": "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A==",
"cpu": [
"arm"
],
@@ -2887,13 +2898,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-arm": "1.3.2"
+ "@img/sharp-libvips-linux-arm": "1.3.3"
}
},
"node_modules/@img/sharp-linux-arm64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz",
- "integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.4.tgz",
+ "integrity": "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ==",
"cpu": [
"arm64"
],
@@ -2909,13 +2920,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-arm64": "1.3.2"
+ "@img/sharp-libvips-linux-arm64": "1.3.3"
}
},
"node_modules/@img/sharp-linux-ppc64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz",
- "integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.4.tgz",
+ "integrity": "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ==",
"cpu": [
"ppc64"
],
@@ -2931,13 +2942,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-ppc64": "1.3.2"
+ "@img/sharp-libvips-linux-ppc64": "1.3.3"
}
},
"node_modules/@img/sharp-linux-riscv64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz",
- "integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.4.tgz",
+ "integrity": "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA==",
"cpu": [
"riscv64"
],
@@ -2953,13 +2964,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-riscv64": "1.3.2"
+ "@img/sharp-libvips-linux-riscv64": "1.3.3"
}
},
"node_modules/@img/sharp-linux-s390x": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz",
- "integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.4.tgz",
+ "integrity": "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ==",
"cpu": [
"s390x"
],
@@ -2975,13 +2986,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-s390x": "1.3.2"
+ "@img/sharp-libvips-linux-s390x": "1.3.3"
}
},
"node_modules/@img/sharp-linux-x64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz",
- "integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.4.tgz",
+ "integrity": "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA==",
"cpu": [
"x64"
],
@@ -2997,13 +3008,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linux-x64": "1.3.2"
+ "@img/sharp-libvips-linux-x64": "1.3.3"
}
},
"node_modules/@img/sharp-linuxmusl-arm64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz",
- "integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.4.tgz",
+ "integrity": "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA==",
"cpu": [
"arm64"
],
@@ -3019,13 +3030,13 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-arm64": "1.3.2"
+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.3"
}
},
"node_modules/@img/sharp-linuxmusl-x64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz",
- "integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.4.tgz",
+ "integrity": "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg==",
"cpu": [
"x64"
],
@@ -3041,17 +3052,17 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-x64": "1.3.2"
+ "@img/sharp-libvips-linuxmusl-x64": "1.3.3"
}
},
"node_modules/@img/sharp-wasm32": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz",
- "integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.4.tgz",
+ "integrity": "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA==",
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
"optional": true,
"dependencies": {
- "@emnapi/runtime": "^1.11.1"
+ "@emnapi/runtime": "^1.11.3"
},
"engines": {
"node": ">=20.9.0"
@@ -3060,27 +3071,17 @@
"url": "https://opencollective.com/libvips"
}
},
- "node_modules/@img/sharp-wasm32/node_modules/@emnapi/runtime": {
- "version": "1.11.2",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.2.tgz",
- "integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
- }
- },
"node_modules/@img/sharp-webcontainers-wasm32": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz",
- "integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.4.tgz",
+ "integrity": "sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA==",
"cpu": [
"wasm32"
],
"license": "Apache-2.0",
"optional": true,
"dependencies": {
- "@img/sharp-wasm32": "0.35.3"
+ "@img/sharp-wasm32": "0.35.4"
},
"engines": {
"node": ">=20.9.0"
@@ -3090,9 +3091,9 @@
}
},
"node_modules/@img/sharp-win32-arm64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz",
- "integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.4.tgz",
+ "integrity": "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw==",
"cpu": [
"arm64"
],
@@ -3109,9 +3110,9 @@
}
},
"node_modules/@img/sharp-win32-ia32": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz",
- "integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.4.tgz",
+ "integrity": "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw==",
"cpu": [
"ia32"
],
@@ -3128,9 +3129,9 @@
}
},
"node_modules/@img/sharp-win32-x64": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz",
- "integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.4.tgz",
+ "integrity": "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg==",
"cpu": [
"x64"
],
@@ -3877,9 +3878,9 @@
}
},
"node_modules/@oxc-project/types": {
- "version": "0.143.0",
- "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.143.0.tgz",
- "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==",
+ "version": "0.146.0",
+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.146.0.tgz",
+ "integrity": "sha512-XC0QsnnhVe7sLIWmYmdPw7x5P0h4W8vUU3Nv1ySgWXtvCz8NizoAEpGXA0sOYoJQV2Rl13LgURAHQ5cI5ILCSA==",
"dev": true,
"license": "MIT",
"funding": {
@@ -5647,6 +5648,78 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@redis/bloom": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-6.2.1.tgz",
+ "integrity": "sha512-huQgNLaCIZfQ9SeLn4q9124uOUd8HbZDYHwwUzNcRgHqCHiHKl2dDxMqJCeWh8cMqZAoWuHR8XnWbDMIf+o7ag==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "@redis/client": "^6.2.1"
+ }
+ },
+ "node_modules/@redis/client": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@redis/client/-/client-6.2.1.tgz",
+ "integrity": "sha512-LzxBY7SIBvvJiyCgcaJZZakE3fJrZZ++i24+EDW9fKpCl68D35uJcKFpZZwCfOoG9WZTbyZlMzMeM0gtOAMU9Q==",
+ "license": "MIT",
+ "dependencies": {
+ "cluster-key-slot": "1.1.2"
+ },
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "@node-rs/xxhash": "^1.1.0",
+ "@opentelemetry/api": ">=1 <2"
+ },
+ "peerDependenciesMeta": {
+ "@node-rs/xxhash": {
+ "optional": true
+ },
+ "@opentelemetry/api": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@redis/json": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@redis/json/-/json-6.2.1.tgz",
+ "integrity": "sha512-AFIUJ8Gj0DaaSBHYuSt8+O0oYWM+50OK1c0OmodB7XERIA8+BbyV3O4v76f9iccWasd1/7qjfZTpuzexUaZtrQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "@redis/client": "^6.2.1"
+ }
+ },
+ "node_modules/@redis/search": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@redis/search/-/search-6.2.1.tgz",
+ "integrity": "sha512-2vfOAOyYFE7UUw3sBBlkqqruBtOUS4HRY5MtW4hp83llrwvtrTE4r22CEqXddlV+54zkLxBE4nmsIJ/dpezQrQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "@redis/client": "^6.2.1"
+ }
+ },
+ "node_modules/@redis/time-series": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-6.2.1.tgz",
+ "integrity": "sha512-kiYniph04dJOole+L359B6C9E+jYS2uDP7hca6Onj0xF38ZIpyxARO0Iq0W4ZRn1e8Q6vqW00QFZVSMRA/2Ijw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "@redis/client": "^6.2.1"
+ }
+ },
"node_modules/@replit/codemirror-lang-nix": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@replit/codemirror-lang-nix/-/codemirror-lang-nix-6.0.1.tgz",
@@ -5696,10 +5769,27 @@
"@lezer/lr": "^1.0.0"
}
},
+ "node_modules/@rolldown/binding-android-arm-eabi": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.5.tgz",
+ "integrity": "sha512-DLe/i+l8ynIBY7XEQ191TeZvCoowIGa18R+dIV30GW7DiOtp74i/xX8hs8GUjW5ARV7VZuie3d6AumSmCwbeRA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
"node_modules/@rolldown/binding-android-arm64": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.3.tgz",
- "integrity": "sha512-zrJtHDcaZJ1Fp7xf4hNl+7seH9Cn/N5TwLYkhgXREtBwAd/jaqW3uqeHxpDugJLVICWg4eW44kOQEGJ1r6jCGw==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.5.tgz",
+ "integrity": "sha512-zXcwKlQApYAOELHd8PwKDFkagYF9Wy4e0RJ+0qnzl9Pjnpj75TEG8ufv40p2J7kCEfwZAsNiuzRIyNNMWT38ig==",
"cpu": [
"arm64"
],
@@ -5714,9 +5804,9 @@
}
},
"node_modules/@rolldown/binding-darwin-arm64": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.3.tgz",
- "integrity": "sha512-ieIiibVCp0tX7TLu2cafoNPv8wJyYi01ekXpbf8q2j7F4rGAhhXb/eQh7ge9DRBY78GwmRQtvjZDux7EDbA8kA==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.5.tgz",
+ "integrity": "sha512-dK4QakI42nzWgJT5sm4y4y/O//D4OxM75/cH28RLV+nzIN9AY+YsbuUVrUTjlLjXR6vpyxFbSsbmNuJ6BP9sww==",
"cpu": [
"arm64"
],
@@ -5731,9 +5821,9 @@
}
},
"node_modules/@rolldown/binding-darwin-x64": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.3.tgz",
- "integrity": "sha512-Zh9tCon19eDXJoihx0rqKhMUlMYqzwj3aPsSuHmI4RWZh62dWUL+DJN4C5YQya5TcQBJU/Fe8+rY0jhXTQITqA==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.5.tgz",
+ "integrity": "sha512-fqSALaUu1Wjd1nK2uW2kJDWdLCc8lx1IcY+MTY26Aurfdx19anlzhqXOgCFbBFQnlFDTn4TC1/7Nz4Bl2mLP3A==",
"cpu": [
"x64"
],
@@ -5748,9 +5838,9 @@
}
},
"node_modules/@rolldown/binding-freebsd-x64": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.3.tgz",
- "integrity": "sha512-nGbJWewA1wrXXZiQhjAT5rhibGfns5ZNkDVqxsO6zJ3f3YvpoDNNmGMSbbhLuXKjNScaBJVOAboztAWVespQMg==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.5.tgz",
+ "integrity": "sha512-/vCnNxlkxs9tKxNDcyWUePpJ/PgTzxIaVhoM5SmG8UV+GR/IcPam4VYxi7GIMo7PSDuNqlJqvprqii9NqqVCMw==",
"cpu": [
"x64"
],
@@ -5765,9 +5855,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.3.tgz",
- "integrity": "sha512-QNniJr5Kml0kDEB98jiDOJjXNroxIIi0IXIbdYzY26Xt1pVbeP62+KnoIZLwirOymX/0jDk/2gI/bNUv7A7OIw==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.5.tgz",
+ "integrity": "sha512-abk0NLA519LxRCszmbE0jYKuQ9YPocOXTiOXOo6Yr+YAT95VH+PtqYAjOJvGKt3viEd/x4qzabAlwd5bHOOARg==",
"cpu": [
"arm"
],
@@ -5782,16 +5872,13 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-gnu": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.3.tgz",
- "integrity": "sha512-TkqEAcmmvH3I/q4114NB4RVt6241Dao48pF45uLcFGrwAaIn0iITgTAKP/dLjbN0R4buJjGb91+UHSoFmpgIWw==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.5.tgz",
+ "integrity": "sha512-Y7eALiJ8lr0M2HH103Js+g7V34wf6snlpZLAsHI90uLhr3PVlNsbFVAXJC9d/V6BnPyKtpSwI+NcB/RLxsQxuA==",
"cpu": [
"arm64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5802,16 +5889,13 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-musl": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.3.tgz",
- "integrity": "sha512-NHqjnxpsndf4MPymxteFAWHHfkTL8HjWh1KB7z23ofZ6QO2euONuxDXjat69dKZRALnGypg8k8SsK8vZJoXv1Q==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.5.tgz",
+ "integrity": "sha512-xMvZgnbZg4YVnR/AX2b3oOPDTFYJvUVaJg5FedA/LuvexAtXibZQej4cnTkw3rjsJ/ggUROB64TdtETiim+FYA==",
"cpu": [
"arm64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5822,16 +5906,13 @@
}
},
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.3.tgz",
- "integrity": "sha512-6tbrbwfz5GB9DQ4Jwo6hy9v+vR31xZlvzZ6n5Xut6Hhx5PvrA9q/HsK8KMaYQp063iqZGXwNvZtYNLD7EM/x0w==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.5.tgz",
+ "integrity": "sha512-GRjeqTUDHTo5GwntsLaAMcBahG3nlpjftXWZLN73HiYQlhwEowvarFgQnRnQZtIp4keXX7quXFbG38uPZBa2EA==",
"cpu": [
"ppc64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5842,16 +5923,13 @@
}
},
"node_modules/@rolldown/binding-linux-s390x-gnu": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.3.tgz",
- "integrity": "sha512-oyuXxXmoZHjXC917IAPFAAv4wWAa0cM9afk8nx1+9/jNNOX1uPf8yDA6p7G0RypOfw/X0PQt5IfoquY1um+zSg==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.5.tgz",
+ "integrity": "sha512-vLNTR45F2Uwc8AufkNXPmB4VliaXs+FvcheEogIzOXzO4l+LzieXF5A/TWxLy5HtqpsRCHUfd0lPVrrdgXdLHQ==",
"cpu": [
"s390x"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5862,16 +5940,13 @@
}
},
"node_modules/@rolldown/binding-linux-x64-gnu": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.3.tgz",
- "integrity": "sha512-TytMwF2KVGqP2tgd0I1OY0PAv78dZRAYcF5ssDzjM34SUXCED3uXvSd5+lHoC0bTD6eEdFz7LdQNCO1y0oVk9w==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.5.tgz",
+ "integrity": "sha512-Mgj59/HTuYeK9Gz2MA+mBWKnHsAgkBSec15ZMb1st3oIfFbX7gCjOae7GydHhzcyQi9Z/7M1QuN9bR3oFqF0jQ==",
"cpu": [
"x64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5882,16 +5957,13 @@
}
},
"node_modules/@rolldown/binding-linux-x64-musl": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.3.tgz",
- "integrity": "sha512-/E9m3qstrJFVPoULV25mVQblSNExY2+kBsYe4sy0Tn0yOOgJ8wZbZt3KnRbF/XeU2Gl1STKUQnDNTqhIE5MD4A==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.5.tgz",
+ "integrity": "sha512-mY8AP0/ichsbhAxGnLa3d3+MwV0EfgrPND2bplI3Ym8T6R2pJ0N87bvrKVwNXmdy3jnr6eQBecdqx/HMknBmpA==",
"cpu": [
"x64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -5902,9 +5974,9 @@
}
},
"node_modules/@rolldown/binding-openharmony-arm64": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.3.tgz",
- "integrity": "sha512-Kr0OcsoQI816i6HOl3vFHpd1K0eZyh76zgfj4c1nTyaTsd5r2Mj1lwM4R90y/qaCfmTn9eHy0SKwi98eitRxug==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.5.tgz",
+ "integrity": "sha512-8SLssA2oweAxyRgDp789ACfRb/3P+zNRJpzZxSizxF9m8NUDQ4+3xjo8ttjhVGGw6Qxb70oZiEtIjaKikCO7Yw==",
"cpu": [
"arm64"
],
@@ -5919,9 +5991,9 @@
}
},
"node_modules/@rolldown/binding-win32-arm64-msvc": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.3.tgz",
- "integrity": "sha512-hOtMwTqnME+/gJcH/PCZ0wn0zPUjiWOgkHpxbSJpfGKMezHltx1S7/k1SitzVa7Ww2cqrDDaFbZEhcJZO8o+Jw==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.5.tgz",
+ "integrity": "sha512-vGbruD5zquhoc8D9SViXgN2FBJtNdTyQ4DtG+SWiEGlJiAzoKcZ2xp+xuXCffhubVdt0NJlTZqkeRuERy7g8Cw==",
"cpu": [
"arm64"
],
@@ -5936,9 +6008,9 @@
}
},
"node_modules/@rolldown/binding-win32-x64-msvc": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.3.tgz",
- "integrity": "sha512-ekcqMMkI2PlhYnfzQnB/cEdYUVVJViWvoUyLrbzgDoi3Snfc1mVBwdnc306ufA5ejy8JSPjT2RlW1nQSjW7efg==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.5.tgz",
+ "integrity": "sha512-e/SXpgISz+IoqVcSSI0rx/d/he8zqLex+/rCWpnHpmVfmPIUjag9H6P7zotf0gJHwPUhQxZ/mF8tr6acebT9yw==",
"cpu": [
"x64"
],
@@ -6500,9 +6572,9 @@
}
},
"node_modules/@svgr/core/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -6902,12 +6974,12 @@
}
},
"node_modules/@tanstack/react-virtual": {
- "version": "3.14.9",
- "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.14.9.tgz",
- "integrity": "sha512-qZyr0FZDP8rDC4WBhsryIZmAd9bveJvFGUJJtskWaew6/0dTRS6wZxnR6VQ5bY2KwL3LjerrHqQLk3a0GKcPXQ==",
+ "version": "3.14.10",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.14.10.tgz",
+ "integrity": "sha512-SRyoUbdFMRHuYXMijV5H4ZarQWpXkj3iANq8OFre+pybeVap8ZJjZ3Nz9bVjx4d8PfobVUQUdKyyyHYk3E+djw==",
"license": "MIT",
"dependencies": {
- "@tanstack/virtual-core": "3.17.7"
+ "@tanstack/virtual-core": "3.17.8"
},
"funding": {
"type": "github",
@@ -6919,9 +6991,9 @@
}
},
"node_modules/@tanstack/virtual-core": {
- "version": "3.17.7",
- "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.17.7.tgz",
- "integrity": "sha512-bp+v10y65sp2H7WpWfIMyxTNfl8ZVfxFTLRjPIFRryi6FV/J33z4IS53WO4pTk36KlvJ4iLiQz+oaydDC1xbcA==",
+ "version": "3.17.8",
+ "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.17.8.tgz",
+ "integrity": "sha512-BfEvehNpOT75r5Ksc5xW6NZuXujTfb7nlSEyVu4XHG3gdxNg1KqXruWbDewXOUaUYIo4oRbSfkjIajz4MAT8tA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -6966,9 +7038,9 @@
"license": "MIT"
},
"node_modules/@testing-library/jest-dom": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-7.0.0.tgz",
- "integrity": "sha512-HKAH9C6mBo5yBG6yRO5i43L2iisencAo5z+o5P/saHUoY+miC5ivXRxHBJcFyB5ypPNxHJdK3BoF/3O4DIptMg==",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-7.0.1.tgz",
+ "integrity": "sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -6985,7 +7057,13 @@
"yarn": ">=1"
},
"peerDependencies": {
- "@testing-library/dom": ">=10 <11"
+ "@testing-library/dom": ">=10 <11",
+ "vitest": ">= 0.32"
+ },
+ "peerDependenciesMeta": {
+ "vitest": {
+ "optional": true
+ }
}
},
"node_modules/@testing-library/react": {
@@ -7017,9 +7095,9 @@
}
},
"node_modules/@testing-library/user-event": {
- "version": "14.6.1",
- "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz",
- "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==",
+ "version": "14.6.5",
+ "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.5.tgz",
+ "integrity": "sha512-FhqjldLTpteueBaKflhNFlMT3+PM0O5fiBUivht6b9CZ1eesJyy7+g3Jr7XwJzt/Hip3ZG5hWwK1MX1FuDiE4w==",
"dev": true,
"license": "MIT",
"engines": {
@@ -7805,14 +7883,14 @@
}
},
"node_modules/@vitest/coverage-v8": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz",
- "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.11.tgz",
+ "integrity": "sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@bcoe/v8-coverage": "^1.0.2",
- "@vitest/utils": "4.1.10",
+ "@vitest/utils": "4.1.11",
"ast-v8-to-istanbul": "^1.0.0",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
@@ -7826,8 +7904,8 @@
"url": "https://opencollective.com/vitest"
},
"peerDependencies": {
- "@vitest/browser": "4.1.10",
- "vitest": "4.1.10"
+ "@vitest/browser": "4.1.11",
+ "vitest": "4.1.11"
},
"peerDependenciesMeta": {
"@vitest/browser": {
@@ -7836,16 +7914,16 @@
}
},
"node_modules/@vitest/expect": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz",
- "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz",
+ "integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@standard-schema/spec": "^1.1.0",
"@types/chai": "^5.2.2",
- "@vitest/spy": "4.1.10",
- "@vitest/utils": "4.1.10",
+ "@vitest/spy": "4.1.11",
+ "@vitest/utils": "4.1.11",
"chai": "^6.2.2",
"tinyrainbow": "^3.1.0"
},
@@ -7854,13 +7932,13 @@
}
},
"node_modules/@vitest/mocker": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz",
- "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz",
+ "integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/spy": "4.1.10",
+ "@vitest/spy": "4.1.11",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.21"
},
@@ -7891,9 +7969,9 @@
}
},
"node_modules/@vitest/pretty-format": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz",
- "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz",
+ "integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -7904,13 +7982,13 @@
}
},
"node_modules/@vitest/runner": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz",
- "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz",
+ "integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/utils": "4.1.10",
+ "@vitest/utils": "4.1.11",
"pathe": "^2.0.3"
},
"funding": {
@@ -7918,14 +7996,14 @@
}
},
"node_modules/@vitest/snapshot": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz",
- "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz",
+ "integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/pretty-format": "4.1.10",
- "@vitest/utils": "4.1.10",
+ "@vitest/pretty-format": "4.1.11",
+ "@vitest/utils": "4.1.11",
"magic-string": "^0.30.21",
"pathe": "^2.0.3"
},
@@ -7934,9 +8012,9 @@
}
},
"node_modules/@vitest/spy": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz",
- "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz",
+ "integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==",
"dev": true,
"license": "MIT",
"funding": {
@@ -7944,13 +8022,13 @@
}
},
"node_modules/@vitest/ui": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.10.tgz",
- "integrity": "sha512-EOUqfXHTXtpSHsyLHH40ts3Ue+hRhSGwzwzMlK0dTEOLSDYyOXLyr5JDGmHQWhN2DYI30gw6dVx3cdgM9FZl+Q==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.11.tgz",
+ "integrity": "sha512-r/rwyKoev21mWdRGSEkZOqkQ2BYy68mwjihg9M90nNRbf4NGrgzZ4cj6JNCEwlOGJkbKeMgsjlykvwKUbRr7gw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/utils": "4.1.10",
+ "@vitest/utils": "4.1.11",
"fflate": "^0.8.2",
"flatted": "^3.4.2",
"pathe": "^2.0.3",
@@ -7962,17 +8040,17 @@
"url": "https://opencollective.com/vitest"
},
"peerDependencies": {
- "vitest": "4.1.10"
+ "vitest": "4.1.11"
}
},
"node_modules/@vitest/utils": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz",
- "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz",
+ "integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/pretty-format": "4.1.10",
+ "@vitest/pretty-format": "4.1.11",
"convert-source-map": "^2.0.0",
"tinyrainbow": "^3.1.0"
},
@@ -7981,9 +8059,9 @@
}
},
"node_modules/@xmldom/xmldom": {
- "version": "0.8.13",
- "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz",
- "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==",
+ "version": "0.8.15",
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.15.tgz",
+ "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -8288,9 +8366,9 @@
}
},
"node_modules/app-builder-lib/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -8605,9 +8683,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.10.32",
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.32.tgz",
- "integrity": "sha512-wbPvpyjJPC0zdfdKXxqEL3Ea+bOMD/87X4lftiJkkaBiuG6ALQy1SLmEd7BSmVCuwCQsBrCamgBoLyfFDD1EPg==",
+ "version": "2.11.23",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.23.tgz",
+ "integrity": "sha512-le521dGVfxM7yRX0EikCoSz+rOK+hHzdDt/E7mG1jOJB/6WAAUuwVroLwaB7ApaUsz5Q0kFlDXLSA9MheUIfRQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -8636,9 +8714,9 @@
}
},
"node_modules/better-sqlite3": {
- "version": "13.0.2",
- "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-13.0.2.tgz",
- "integrity": "sha512-jW6oufeDhXZaiX9Lw5A+oerVClx4iFrI6uDj1zu7SqUAjak9vbJvA0NEcKLNxHiQHb6kYCoFzzXYV0YOauhV3g==",
+ "version": "13.0.3",
+ "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-13.0.3.tgz",
+ "integrity": "sha512-RbOBxmLBG8uvFUc15X9+9SFemKcQ0WBuISBVkpuiaUB2qblC8UWlHEjdWVoZ8AdhSwmoEgsiXKfopX0CQxaACQ==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -8716,9 +8794,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.28.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
- "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
+ "version": "4.29.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz",
+ "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==",
"dev": true,
"funding": [
{
@@ -8736,11 +8814,11 @@
],
"license": "MIT",
"dependencies": {
- "baseline-browser-mapping": "^2.10.12",
- "caniuse-lite": "^1.0.30001782",
- "electron-to-chromium": "^1.5.328",
- "node-releases": "^2.0.36",
- "update-browserslist-db": "^1.2.3"
+ "baseline-browser-mapping": "^2.11.23",
+ "caniuse-lite": "^1.0.30001810",
+ "electron-to-chromium": "^1.5.427",
+ "node-releases": "^2.0.55",
+ "update-browserslist-db": "^1.3.3"
},
"bin": {
"browserslist": "cli.js"
@@ -8759,6 +8837,7 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
+ "dev": true,
"license": "MIT"
},
"node_modules/buildcheck": {
@@ -8828,9 +8907,9 @@
}
},
"node_modules/builder-util/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -8953,9 +9032,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001793",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz",
- "integrity": "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==",
+ "version": "1.0.30001810",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
+ "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"dev": true,
"funding": [
{
@@ -9162,6 +9241,15 @@
"node": ">=6"
}
},
+ "node_modules/cluster-key-slot": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz",
+ "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/cmdk": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cmdk/-/cmdk-1.1.1.tgz",
@@ -9329,39 +9417,10 @@
"dev": true,
"license": "MIT"
},
- "node_modules/concat-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
- "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
- "engines": [
- "node >= 6.0"
- ],
- "license": "MIT",
- "dependencies": {
- "buffer-from": "^1.0.0",
- "inherits": "^2.0.3",
- "readable-stream": "^3.0.2",
- "typedarray": "^0.0.6"
- }
- },
- "node_modules/concat-stream/node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "license": "MIT",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/concurrently": {
- "version": "10.0.4",
- "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-10.0.4.tgz",
- "integrity": "sha512-trZql+7l/0+WRAsAnEdctr4+iiOS6ZrViI6H8QWcCF9MFS/LT0dKpe8vluB1to6it+OxSI4VospFTIFMW8DJRw==",
+ "version": "10.0.5",
+ "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-10.0.5.tgz",
+ "integrity": "sha512-JaP/CoftUrCcAFW/g//RbgEGwlelnEae6cfBLgH6ZdO6s8jPkn6p9SB9u6pdVxYXoiSnFqseOlHfrEfF82TVOg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -9518,13 +9577,13 @@
}
},
"node_modules/conventional-changelog-angular": {
- "version": "9.2.1",
- "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-9.2.1.tgz",
- "integrity": "sha512-oWSL6ZhnXbYraOFTK3PgRAQJ8fADDAEv5K6AdeyQPLvjFmhG8+ejL0jZZp/R7vTmGJaBvZEE+sE7dB4bCv7sAw==",
+ "version": "9.4.0",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-9.4.0.tgz",
+ "integrity": "sha512-HdxRxuS8bBXVIuo4V82gvSwAXT0vYQUizrjs/izmPg5JdDstr8v8I5hduGL3iQbG+o310dUDxC4+LetuS5hu9w==",
"dev": true,
"license": "ISC",
"dependencies": {
- "@conventional-changelog/template": "^1.2.1"
+ "@conventional-changelog/template": "^1.4.0"
},
"engines": {
"node": ">=22"
@@ -9674,9 +9733,9 @@
}
},
"node_modules/cosmiconfig/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -9761,9 +9820,9 @@
"license": "MIT"
},
"node_modules/cytoscape": {
- "version": "3.34.0",
- "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.0.tgz",
- "integrity": "sha512-62rNSrioXw93uliKFBwjukeQyeWwH2PqDrTac31r2P6464u3AUvTk0xS4LVvT251g7IgkFunrI48ZEZGjywSOg==",
+ "version": "3.34.1",
+ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.1.tgz",
+ "integrity": "sha512-Lr0RvH9H75y9ar8h9Toy6u4lxRSCcxUq+hHcQ26sVWo6BnaQp1gwEZOYqwuYTZhyW7npyKnNLP8oJ2p1/3OZ7g==",
"dev": true,
"license": "MIT",
"engines": {
@@ -9856,15 +9915,6 @@
"node": ">=0.4.0"
}
},
- "node_modules/denque": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
- "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=0.10"
- }
- },
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -9976,9 +10026,9 @@
}
},
"node_modules/dmg-builder/node_modules/js-yaml": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -10377,9 +10427,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.5.361",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.361.tgz",
- "integrity": "sha512-Q6Hts7N9FnJc5LeGRINFvLhCI9xZmNtTDe5ZbcVezQz7cU4a8Aua3GH1b8J2XY8Al9PF+OCwYqhgsOOheMdvkA==",
+ "version": "1.5.428",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.428.tgz",
+ "integrity": "sha512-1JxbaFJj1bRKurj1uY3l4xxpU9kOUAUjcIgApj0qu1Pao5GhoIWI8iL0BeMYJ2njig1hBx0A7eKD9VGjH9wlHw==",
"dev": true,
"license": "ISC"
},
@@ -10522,15 +10572,16 @@
}
},
"node_modules/es-toolkit": {
- "version": "1.50.0",
- "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.50.0.tgz",
- "integrity": "sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==",
+ "version": "1.51.0",
+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.51.0.tgz",
+ "integrity": "sha512-zC2lQGkM7QX+Gm6iM3+WIdZJzthsEd14LvRNJneSO2hzyz/zNBENR8+YXWo1cKxgPBtV6ksPYHELbcwBRzmdCw==",
"dev": true,
"license": "MIT",
"workspaces": [
"docs",
"benchmarks",
- "tests/types"
+ "tests/types",
+ "tests/browser-compat"
]
},
"node_modules/esbuild": {
@@ -10605,9 +10656,9 @@
}
},
"node_modules/eslint": {
- "version": "10.8.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.8.0.tgz",
- "integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==",
+ "version": "10.8.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.8.1.tgz",
+ "integrity": "sha512-wqA7W2jbsC/BnV9Iv1UZpKVFkO1AdNoSmYW8NWG4HNOBbkAMvIqDZ27pI2f07dqn583NcIC44ckjAcOXDL1QbQ==",
"dev": true,
"license": "MIT",
"workspaces": [
@@ -10684,9 +10735,9 @@
}
},
"node_modules/eslint-plugin-react-refresh": {
- "version": "0.5.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.3.tgz",
- "integrity": "sha512-5EMmLCV98Pi4o/f/3DP/v/tNqLHMIc9I8LKClNDWhZ9JTho89/kQcitCXQBMG7sAfVRK0Ie3T2EDOzp1YXYiVA==",
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.4.tgz",
+ "integrity": "sha512-7bqTKz7T0r+HKWFarNXByDE9/5+73wI2ru+M3zuqGbR7s/b/5/pQJXZoufWlrngqGqoZto73ZkGumCdLxk+4rw==",
"dev": true,
"license": "MIT",
"peerDependencies": {
@@ -10969,9 +11020,9 @@
"license": "Unlicense"
},
"node_modules/fast-uri": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz",
- "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==",
+ "version": "3.1.8",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz",
+ "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==",
"dev": true,
"funding": [
{
@@ -11229,24 +11280,20 @@
}
},
"node_modules/framer-motion": {
- "version": "12.43.0",
- "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.43.0.tgz",
- "integrity": "sha512-1eaL3RvR/kAlbG7UYcpMptEyzPoENO0c6w7ZnB3/hh2vSAz/6uGAFn6fdoqTBguNstf3MsFhJHsD/0DHiclG+g==",
+ "version": "13.1.1",
+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-13.1.1.tgz",
+ "integrity": "sha512-B/xn2TPS4f61cEBLFjiYlQFnBZUW1YVj/LM+C+N4OP8Rs95VLEI2ot/RlfBg111la/EiyECFaJJi/A3FWA8MUA==",
"license": "MIT",
"dependencies": {
- "motion-dom": "^12.43.0",
- "motion-utils": "^12.39.0",
+ "motion-dom": "^13.1.1",
+ "motion-utils": "^13.0.0",
"tslib": "^2.4.0"
},
"peerDependencies": {
- "@emotion/is-prop-valid": "*",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
- "@emotion/is-prop-valid": {
- "optional": true
- },
"react": {
"optional": true
},
@@ -11844,9 +11891,9 @@
}
},
"node_modules/iconv-lite": {
- "version": "0.7.2",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
- "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
+ "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
@@ -12205,9 +12252,9 @@
}
},
"node_modules/jose": {
- "version": "6.2.8",
- "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.8.tgz",
- "integrity": "sha512-Bsdjwm3Qsd/P0jR+BHDe3LytDfY7WBq2HmCCLIwuVRHMuEC9ae7/R474GIUdF1NgCyZjzVo/A9DOiOBtXq8ZoQ==",
+ "version": "6.2.9",
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.9.tgz",
+ "integrity": "sha512-XrchZOFZUl/T3vTwRe8XK+cJrGtMF4th1ARnDfwbBXFKThGhlsxEE4Zu03AD/bjJSt/9jT/mxrOCkJWOg77aPA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/panva"
@@ -14098,23 +14145,19 @@
}
},
"node_modules/motion": {
- "version": "12.43.0",
- "resolved": "https://registry.npmjs.org/motion/-/motion-12.43.0.tgz",
- "integrity": "sha512-BQgQbSa9Hn3/mtbib0MK53y6JSANa+YKUKlaYnWzAVDH424RYQ5LVpV3pNiWH00BA2z4ojsSdMzqT7g2FQwjuQ==",
+ "version": "13.1.1",
+ "resolved": "https://registry.npmjs.org/motion/-/motion-13.1.1.tgz",
+ "integrity": "sha512-WNZoK6xiF+kkTqkZ5K7FDDh6A8BG4i5Hc7KXtW8gtTxkpJFds+hIOrDaQGKjQj/AE/i4hJqAaUHEqp/Qo02y6Q==",
"license": "MIT",
"dependencies": {
- "framer-motion": "^12.43.0",
+ "framer-motion": "^13.1.1",
"tslib": "^2.4.0"
},
"peerDependencies": {
- "@emotion/is-prop-valid": "*",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
- "@emotion/is-prop-valid": {
- "optional": true
- },
"react": {
"optional": true
},
@@ -14124,18 +14167,18 @@
}
},
"node_modules/motion-dom": {
- "version": "12.43.0",
- "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.43.0.tgz",
- "integrity": "sha512-azKON4d9S65PEoFUiQTMTgPheEmzf2QngdRc50AKfJp9Q9mmcBVw22c8eMq9k8kxOFHdL7+WZY7N/5F/lwiDag==",
+ "version": "13.1.1",
+ "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-13.1.1.tgz",
+ "integrity": "sha512-XSf8VYWSB6G/0IY3rWVbyLcxWXtAVHkN1PQE2agTaCv3u8RGvbwu56TyyR/MNzBqqNavEBTZzErcxI1TxBrjcA==",
"license": "MIT",
"dependencies": {
- "motion-utils": "^12.39.0"
+ "motion-utils": "^13.0.0"
}
},
"node_modules/motion-utils": {
- "version": "12.39.0",
- "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.39.0.tgz",
- "integrity": "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ==",
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-13.0.0.tgz",
+ "integrity": "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ==",
"license": "MIT"
},
"node_modules/mrmime": {
@@ -14155,14 +14198,13 @@
"license": "MIT"
},
"node_modules/multer": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz",
- "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==",
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/multer/-/multer-2.4.0.tgz",
+ "integrity": "sha512-7dqa0ZcFfzbefdTuIkzOSMvZWC0J7FLqBOjJUZvDCXShIURWKxAyTT1wHhnE5q19c7jOJf43IYYKjBmZVZmvhg==",
"license": "MIT",
"dependencies": {
"append-field": "^1.0.0",
"busboy": "^1.6.0",
- "concat-stream": "^2.0.0",
"type-is": "^1.6.18"
},
"engines": {
@@ -14217,15 +14259,14 @@
}
},
"node_modules/mysql2": {
- "version": "3.23.2",
- "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.23.2.tgz",
- "integrity": "sha512-fxh3HpQ8vJtu/Mmnd4Xsur19jGjHGzRLMxptiDtOkbX7EVBgnafGSGDx1WGGVmJLClVh2LeeBMMo24IFv8wCyQ==",
+ "version": "3.23.4",
+ "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.23.4.tgz",
+ "integrity": "sha512-J1Rgl8Oy5iw3mOBjKeTMQ3cJNjMYtJYavQVXShsMtSj9rKV8Q1+QaGKNJqDVQFcNINqYYp6Vxd90r69cCoBxBA==",
"license": "MIT",
"dependencies": {
"aws-ssl-profiles": "^1.1.2",
- "denque": "^2.1.0",
"generate-function": "^2.3.1",
- "iconv-lite": "^0.7.2",
+ "iconv-lite": "^0.7.3",
"long": "^5.3.2",
"lru.min": "^1.1.4",
"named-placeholders": "^1.1.6",
@@ -14430,9 +14471,9 @@
"license": "MIT"
},
"node_modules/node-releases": {
- "version": "2.0.46",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.46.tgz",
- "integrity": "sha512-GYVXHE2KnrzAfsAjl4uP++evGFCrAU1jta4ubEjIG7YWt/64Gqv66a30yKwWczVjA6j3bM4nBwH7Pk1JmDHaxQ==",
+ "version": "2.0.55",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz",
+ "integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -15428,12 +15469,13 @@
}
},
"node_modules/qs": {
- "version": "6.15.2",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz",
- "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==",
+ "version": "6.16.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
+ "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
"license": "BSD-3-Clause",
"dependencies": {
- "side-channel": "^1.1.0"
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
},
"engines": {
"node": ">=0.6"
@@ -15617,13 +15659,13 @@
}
},
"node_modules/react-i18next": {
- "version": "17.0.11",
- "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.11.tgz",
- "integrity": "sha512-cDtkXgxjuFTWUH6V+aQn1Ve5vDiUztCNPWW5GtSHDccsgRXO1nE6QFWCEmc1KAutrb3OUv87wFShJL5RhUwPXg==",
+ "version": "17.0.12",
+ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.12.tgz",
+ "integrity": "sha512-lFWPEGkxQ6RhusdUkysFBD58VHfSSzvHBzqMgN0SvfVpdQGfwtNkStTqdy08/sJd7s807qqutgx93fRpD0DJ3Q==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/runtime": "^7.29.2",
+ "@babel/runtime": "^7.29.7",
"html-parse-stringify": "^4.0.1",
"use-sync-external-store": "^1.6.0"
},
@@ -15881,6 +15923,22 @@
"node": ">=8"
}
},
+ "node_modules/redis": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/redis/-/redis-6.2.1.tgz",
+ "integrity": "sha512-Z9VHtgYs48PiQC77X9O2Er8Hj4T+5BtFjT91/vi5Is1D04N72cA946ZslM1ImJw8ZctFBZWAVjM7S5wJNeHMpg==",
+ "license": "MIT",
+ "dependencies": {
+ "@redis/bloom": "6.2.1",
+ "@redis/client": "6.2.1",
+ "@redis/json": "6.2.1",
+ "@redis/search": "6.2.1",
+ "@redis/time-series": "6.2.1"
+ },
+ "engines": {
+ "node": ">= 20.0.0"
+ }
+ },
"node_modules/reflect-metadata": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
@@ -16048,13 +16106,13 @@
}
},
"node_modules/rolldown": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.3.tgz",
- "integrity": "sha512-rn9wpmxplLf7NLNyCk9FyWh3FM43DbY8jOzCdEPzH7uflhTftRbCEpqi6Ly2osgoU8OwObtmavMbWLaWy4LX7A==",
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.5.tgz",
+ "integrity": "sha512-VD2IE5PUG4Oj8zz2VGykiYd5wbnjdIiSsNQb8Qu5B+noEp+A78mu2iVvpp27g8es14Tk9rofNs5Tku9iQCS4fA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@oxc-project/types": "=0.143.0",
+ "@oxc-project/types": "=0.146.0",
"@rolldown/pluginutils": "^1.0.0"
},
"bin": {
@@ -16064,20 +16122,21 @@
"node": "^20.19.0 || >=22.12.0"
},
"optionalDependencies": {
- "@rolldown/binding-android-arm64": "1.2.3",
- "@rolldown/binding-darwin-arm64": "1.2.3",
- "@rolldown/binding-darwin-x64": "1.2.3",
- "@rolldown/binding-freebsd-x64": "1.2.3",
- "@rolldown/binding-linux-arm-gnueabihf": "1.2.3",
- "@rolldown/binding-linux-arm64-gnu": "1.2.3",
- "@rolldown/binding-linux-arm64-musl": "1.2.3",
- "@rolldown/binding-linux-ppc64-gnu": "1.2.3",
- "@rolldown/binding-linux-s390x-gnu": "1.2.3",
- "@rolldown/binding-linux-x64-gnu": "1.2.3",
- "@rolldown/binding-linux-x64-musl": "1.2.3",
- "@rolldown/binding-openharmony-arm64": "1.2.3",
- "@rolldown/binding-win32-arm64-msvc": "1.2.3",
- "@rolldown/binding-win32-x64-msvc": "1.2.3"
+ "@rolldown/binding-android-arm-eabi": "1.2.5",
+ "@rolldown/binding-android-arm64": "1.2.5",
+ "@rolldown/binding-darwin-arm64": "1.2.5",
+ "@rolldown/binding-darwin-x64": "1.2.5",
+ "@rolldown/binding-freebsd-x64": "1.2.5",
+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.5",
+ "@rolldown/binding-linux-arm64-gnu": "1.2.5",
+ "@rolldown/binding-linux-arm64-musl": "1.2.5",
+ "@rolldown/binding-linux-ppc64-gnu": "1.2.5",
+ "@rolldown/binding-linux-s390x-gnu": "1.2.5",
+ "@rolldown/binding-linux-x64-gnu": "1.2.5",
+ "@rolldown/binding-linux-x64-musl": "1.2.5",
+ "@rolldown/binding-openharmony-arm64": "1.2.5",
+ "@rolldown/binding-win32-arm64-msvc": "1.2.5",
+ "@rolldown/binding-win32-x64-msvc": "1.2.5"
}
},
"node_modules/router": {
@@ -16293,9 +16352,9 @@
"license": "ISC"
},
"node_modules/sharp": {
- "version": "0.35.3",
- "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz",
- "integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==",
+ "version": "0.35.4",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz",
+ "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==",
"license": "Apache-2.0",
"dependencies": {
"@img/colour": "^1.1.0",
@@ -16309,31 +16368,31 @@
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
- "@img/sharp-darwin-arm64": "0.35.3",
- "@img/sharp-darwin-x64": "0.35.3",
- "@img/sharp-freebsd-wasm32": "0.35.3",
- "@img/sharp-libvips-darwin-arm64": "1.3.2",
- "@img/sharp-libvips-darwin-x64": "1.3.2",
- "@img/sharp-libvips-linux-arm": "1.3.2",
- "@img/sharp-libvips-linux-arm64": "1.3.2",
- "@img/sharp-libvips-linux-ppc64": "1.3.2",
- "@img/sharp-libvips-linux-riscv64": "1.3.2",
- "@img/sharp-libvips-linux-s390x": "1.3.2",
- "@img/sharp-libvips-linux-x64": "1.3.2",
- "@img/sharp-libvips-linuxmusl-arm64": "1.3.2",
- "@img/sharp-libvips-linuxmusl-x64": "1.3.2",
- "@img/sharp-linux-arm": "0.35.3",
- "@img/sharp-linux-arm64": "0.35.3",
- "@img/sharp-linux-ppc64": "0.35.3",
- "@img/sharp-linux-riscv64": "0.35.3",
- "@img/sharp-linux-s390x": "0.35.3",
- "@img/sharp-linux-x64": "0.35.3",
- "@img/sharp-linuxmusl-arm64": "0.35.3",
- "@img/sharp-linuxmusl-x64": "0.35.3",
- "@img/sharp-webcontainers-wasm32": "0.35.3",
- "@img/sharp-win32-arm64": "0.35.3",
- "@img/sharp-win32-ia32": "0.35.3",
- "@img/sharp-win32-x64": "0.35.3"
+ "@img/sharp-darwin-arm64": "0.35.4",
+ "@img/sharp-darwin-x64": "0.35.4",
+ "@img/sharp-freebsd-wasm32": "0.35.4",
+ "@img/sharp-libvips-darwin-arm64": "1.3.3",
+ "@img/sharp-libvips-darwin-x64": "1.3.3",
+ "@img/sharp-libvips-linux-arm": "1.3.3",
+ "@img/sharp-libvips-linux-arm64": "1.3.3",
+ "@img/sharp-libvips-linux-ppc64": "1.3.3",
+ "@img/sharp-libvips-linux-riscv64": "1.3.3",
+ "@img/sharp-libvips-linux-s390x": "1.3.3",
+ "@img/sharp-libvips-linux-x64": "1.3.3",
+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.3",
+ "@img/sharp-libvips-linuxmusl-x64": "1.3.3",
+ "@img/sharp-linux-arm": "0.35.4",
+ "@img/sharp-linux-arm64": "0.35.4",
+ "@img/sharp-linux-ppc64": "0.35.4",
+ "@img/sharp-linux-riscv64": "0.35.4",
+ "@img/sharp-linux-s390x": "0.35.4",
+ "@img/sharp-linux-x64": "0.35.4",
+ "@img/sharp-linuxmusl-arm64": "0.35.4",
+ "@img/sharp-linuxmusl-x64": "0.35.4",
+ "@img/sharp-webcontainers-wasm32": "0.35.4",
+ "@img/sharp-win32-arm64": "0.35.4",
+ "@img/sharp-win32-ia32": "0.35.4",
+ "@img/sharp-win32-x64": "0.35.4"
},
"peerDependenciesMeta": {
"@types/node": {
@@ -16378,14 +16437,14 @@
}
},
"node_modules/side-channel": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
- "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
- "object-inspect": "^1.13.3",
- "side-channel-list": "^1.0.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
@@ -16533,14 +16592,20 @@
}
},
"node_modules/sonner": {
- "version": "2.0.7",
- "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
- "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==",
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.8.tgz",
+ "integrity": "sha512-UM/ByIoFra8yzV75n1o0Puu0bw5U/9UNnDacrJNspekBewIfsQ3D6ez1nvlWpt7aTsO6rujQtifBpycwIivqlg==",
"dev": true,
"license": "MIT",
"peerDependencies": {
+ "@types/react": "^18.0.0 || ^19.0.0",
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
"node_modules/source-map": {
@@ -17257,12 +17322,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/typedarray": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
- "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
- "license": "MIT"
- },
"node_modules/typescript": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
@@ -17458,9 +17517,9 @@
}
},
"node_modules/update-browserslist-db": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
- "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz",
+ "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==",
"dev": true,
"funding": [
{
@@ -17658,16 +17717,16 @@
}
},
"node_modules/vite": {
- "version": "8.2.0",
- "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.0.tgz",
- "integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==",
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.2.tgz",
+ "integrity": "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"lightningcss": "^1.33.0",
"picomatch": "^4.0.5",
- "postcss": "^8.5.23",
- "rolldown": "~1.2.0",
+ "postcss": "^8.5.26",
+ "rolldown": "~1.2.4",
"tinyglobby": "^0.2.17"
},
"bin": {
@@ -17684,7 +17743,7 @@
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
- "@vitejs/devtools": "^0.4.0",
+ "@vitejs/devtools": "^0.4.0 || ^0.5.0",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",
@@ -17893,9 +17952,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -17917,9 +17973,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -17941,9 +17994,6 @@
"x64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -17965,9 +18015,6 @@
"x64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -18024,19 +18071,19 @@
}
},
"node_modules/vitest": {
- "version": "4.1.10",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz",
- "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==",
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz",
+ "integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/expect": "4.1.10",
- "@vitest/mocker": "4.1.10",
- "@vitest/pretty-format": "4.1.10",
- "@vitest/runner": "4.1.10",
- "@vitest/snapshot": "4.1.10",
- "@vitest/spy": "4.1.10",
- "@vitest/utils": "4.1.10",
+ "@vitest/expect": "4.1.11",
+ "@vitest/mocker": "4.1.11",
+ "@vitest/pretty-format": "4.1.11",
+ "@vitest/runner": "4.1.11",
+ "@vitest/snapshot": "4.1.11",
+ "@vitest/spy": "4.1.11",
+ "@vitest/utils": "4.1.11",
"es-module-lexer": "^2.0.0",
"expect-type": "^1.3.0",
"magic-string": "^0.30.21",
@@ -18064,12 +18111,12 @@
"@edge-runtime/vm": "*",
"@opentelemetry/api": "^1.9.0",
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
- "@vitest/browser-playwright": "4.1.10",
- "@vitest/browser-preview": "4.1.10",
- "@vitest/browser-webdriverio": "4.1.10",
- "@vitest/coverage-istanbul": "4.1.10",
- "@vitest/coverage-v8": "4.1.10",
- "@vitest/ui": "4.1.10",
+ "@vitest/browser-playwright": "4.1.11",
+ "@vitest/browser-preview": "4.1.11",
+ "@vitest/browser-webdriverio": "4.1.11",
+ "@vitest/coverage-istanbul": "4.1.11",
+ "@vitest/coverage-v8": "4.1.11",
+ "@vitest/ui": "4.1.11",
"happy-dom": "*",
"jsdom": "*",
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
@@ -18248,9 +18295,9 @@
"license": "ISC"
},
"node_modules/ws": {
- "version": "8.21.1",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz",
- "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==",
+ "version": "8.21.3",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz",
+ "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
diff --git a/package.json b/package.json
index ee8d0d8e3..d1047d27b 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "termix",
"private": true,
- "version": "2.7.1",
+ "version": "2.8.0",
"description": "Self-hosted SSH and remote desktop management.",
"author": "Karmaa",
"main": "electron/main.cjs",
@@ -12,7 +12,7 @@
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check .",
- "postinstall": "node scripts/patch-app-builder-lib.cjs && node scripts/patch-guacamole-lite.cjs && node scripts/patch-guacamole-common-js.cjs && node scripts/patch-better-sqlite3.cjs && node scripts/patch-nan.cjs && node scripts/patch-xterm-android-ime.cjs",
+ "postinstall": "node scripts/patch-app-builder-lib.cjs && node scripts/patch-guacamole-lite.cjs && node scripts/patch-guacamole-common-js.cjs && node scripts/patch-better-sqlite3.cjs && node scripts/patch-nan.cjs && node scripts/patch-node-pty.cjs && node scripts/patch-xterm-android-ime.cjs && node scripts/patch-ssh2-agent.cjs",
"prepare": "husky || true",
"prebuild": "node scripts/write-electron-build-info.cjs",
"lint": "node scripts/generate-dialect-schema.cjs --check && eslint .",
@@ -43,18 +43,19 @@
"build:mac-dev": "npm run build && npm run electron:rebuild && npm run electron:patch-builder && electron-builder --mac dir --publish=never",
"schema:generate": "node scripts/generate-dialect-schema.cjs",
"schema:check": "node scripts/generate-dialect-schema.cjs --check",
- "schema:migrations": "drizzle-kit generate --config=drizzle.config.sqlite.ts && drizzle-kit generate --config=drizzle.config.pg.ts && drizzle-kit generate --config=drizzle.config.mysql.ts"
+ "schema:migrations": "drizzle-kit generate --config=drizzle.config.sqlite.ts && drizzle-kit generate --config=drizzle.config.pg.ts && drizzle-kit generate --config=drizzle.config.mysql.ts",
+ "plugin:validate-manifest": "node scripts/validate-plugin-manifest.cjs"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.120.0",
"@simplewebauthn/browser": "^13.3.0",
"@simplewebauthn/server": "^13.3.2",
- "@tanstack/react-virtual": "^3.14.9",
+ "@tanstack/react-virtual": "^3.14.10",
"@types/compression": "^1.8.1",
"@types/ldapjs": "^3.0.6",
"axios": "^1.19.0",
"bcryptjs": "^3.0.3",
- "better-sqlite3": "^13.0.2",
+ "better-sqlite3": "^13.0.3",
"body-parser": "^2.3.0",
"chalk": "^6.0.0",
"compression": "^1.8.1",
@@ -64,33 +65,34 @@
"drizzle-orm": "^0.45.2",
"express": "^5.2.1",
"guacamole-lite": "^1.2.0",
- "jose": "^6.2.8",
- "js-yaml": "^5.3.0",
+ "jose": "^6.2.9",
+ "js-yaml": "^5.2.3",
"jsonwebtoken": "^9.0.3",
"jszip": "^3.10.1",
"ldapjs": "^3.0.7",
- "motion": "^12.43.0",
- "multer": "^2.2.0",
- "mysql2": "^3.23.2",
+ "motion": "^13.1.1",
+ "multer": "^2.3.0",
+ "mysql2": "^3.23.4",
"nanoid": "^6.0.1",
"node-pty": "^1.1.0",
"pg": "^8.23.0",
"qrcode": "^1.5.4",
+ "redis": "^6.2.1",
"serialport": "^13.0.0",
- "sharp": "^0.35.3",
+ "sharp": "^0.35.4",
"socks": "^2.8.7",
"speakeasy": "^2.0.0",
"ssh2": "^1.17.0",
"undici": "^8.10.0",
- "ws": "^8.21.1"
+ "ws": "^8.21.3"
},
"devDependencies": {
"@codemirror/autocomplete": "^6.20.3",
"@codemirror/commands": "^6.11.0",
"@codemirror/search": "^6.7.1",
"@codemirror/theme-one-dark": "^6.1.3",
- "@codemirror/view": "^6.43.7",
- "@commitlint/cli": "^21.2.1",
+ "@codemirror/view": "^6.43.9",
+ "@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.0",
"@deadendjs/swagger-jsdoc": "^8.1.2",
"@electron/notarize": "^3.1.1",
@@ -119,9 +121,9 @@
"@radix-ui/react-tooltip": "^1.2.16",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/dom": "^10.4.1",
- "@testing-library/jest-dom": "^7.0.0",
+ "@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.2",
- "@testing-library/user-event": "^14.6.1",
+ "@testing-library/user-event": "^14.6.5",
"@types/better-sqlite3": "^9.6.0",
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
@@ -141,9 +143,9 @@
"@uiw/codemirror-extensions-langs": "^4.25.11",
"@uiw/codemirror-theme-github": "^4.25.11",
"@uiw/react-codemirror": "^4.25.11",
- "@vitejs/plugin-react": "^6.1.0",
- "@vitest/coverage-v8": "^4.1.10",
- "@vitest/ui": "^4.1.10",
+ "@vitejs/plugin-react": "^6.0.5",
+ "@vitest/coverage-v8": "^4.1.11",
+ "@vitest/ui": "^4.1.11",
"@xterm/addon-clipboard": "^0.2.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-search": "^0.16.0",
@@ -153,14 +155,14 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
- "concurrently": "^10.0.4",
- "cytoscape": "^3.34.0",
+ "concurrently": "^10.0.5",
+ "cytoscape": "^3.34.1",
"drizzle-kit": "^0.31.10",
"electron": "^43.4.1",
"electron-builder": "^26.15.3",
- "eslint": "^10.8.0",
+ "eslint": "^10.8.1",
"eslint-plugin-react-hooks": "^7.1.1",
- "eslint-plugin-react-refresh": "^0.5.3",
+ "eslint-plugin-react-refresh": "^0.5.4",
"eslint-plugin-unused-imports": "^4.4.1",
"globals": "^17.11.0",
"guacamole-common-js": "^1.5.0",
@@ -176,8 +178,8 @@
"react-cytoscapejs": "^2.0.0",
"react-dom": "^19.2.8",
"react-h5-audio-player": "^3.10.2",
- "react-hook-form": "^7.85.0",
- "react-i18next": "^17.0.11",
+ "react-hook-form": "^7.84.0",
+ "react-i18next": "^17.0.12",
"react-icons": "^5.7.0",
"react-markdown": "^10.1.0",
"react-pdf": "^10.5.0",
@@ -185,15 +187,15 @@
"react-syntax-highlighter": "^16.1.1",
"react-xtermjs": "^1.0.10",
"remark-gfm": "^4.0.1",
- "sonner": "^2.0.7",
+ "sonner": "^2.0.8",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.4",
"tw-animate-css": "^1.4.0",
"typescript": "~6.0.3",
- "typescript-eslint": "^8.67.0",
- "vite": "^8.2.0",
+ "typescript-eslint": "^8.66.0",
+ "vite": "^8.2.2",
"vite-plugin-svgr": "^5.2.0",
- "vitest": "^4.1.10"
+ "vitest": "^4.1.11"
},
"lint-staged": {
"*.{ts,tsx}": [
@@ -218,13 +220,16 @@
"brace-expansion@2": "^2.1.4",
"brace-expansion@5": "^5.0.9",
"esbuild": "^0.28.1",
- "fast-uri@3": "^3.1.5",
+ "fast-uri@3": "^3.1.6",
"ip-address": "^10.5.0",
- "js-yaml@4": "^4.3.1",
+ "js-yaml@4": "^4.3.2",
"nanoid@3": "^3.3.18",
"postcss": "^8.5.26",
"tar": "^7.5.22",
"undici@6": "^6.28.0",
- "undici@7": "^7.29.0"
+ "undici@7": "^7.29.0",
+ "@xmldom/xmldom": "^0.8.15",
+ "browserslist": "^4.28.7",
+ "qs": "^6.16.0"
}
}
diff --git a/packaging/build/after-pack.cjs b/packaging/build/after-pack.cjs
index 6796a3cee..cbe54d614 100644
--- a/packaging/build/after-pack.cjs
+++ b/packaging/build/after-pack.cjs
@@ -1,12 +1,40 @@
const fs = require("fs");
const path = require("path");
+const { chmodSpawnHelpers } = require("../../scripts/patch-node-pty.cjs");
exports.default = async function afterPack(context) {
const { targets, appOutDir } = context;
const isDir = targets.some((t) => t.name === "dir");
- if (!isDir) return;
+ if (isDir) {
+ const markerPath = path.join(appOutDir, ".portable");
+ fs.writeFileSync(markerPath, "");
+ }
- const markerPath = path.join(appOutDir, ".portable");
- fs.writeFileSync(markerPath, "");
+ if (context.electronPlatformName === "win32") {
+ return;
+ }
+
+ const resourcesDir =
+ context.electronPlatformName === "darwin"
+ ? path.join(
+ appOutDir,
+ `${context.packager.appInfo.productFilename}.app`,
+ "Contents",
+ "Resources",
+ )
+ : path.join(appOutDir, "resources");
+
+ const nodePtyDir = path.join(
+ resourcesDir,
+ "app.asar.unpacked",
+ "node_modules",
+ "node-pty",
+ );
+ const fixed = chmodSpawnHelpers(nodePtyDir);
+ if (fixed > 0) {
+ console.log(
+ `[afterPack] Restored execute bit on ${fixed} packaged spawn-helper binary(ies)`,
+ );
+ }
};
diff --git a/scripts/__fixtures__/manifests/invalid-bad-id.json b/scripts/__fixtures__/manifests/invalid-bad-id.json
new file mode 100644
index 000000000..fa4c6fe67
--- /dev/null
+++ b/scripts/__fixtures__/manifests/invalid-bad-id.json
@@ -0,0 +1,22 @@
+{
+ "id": "Sample_Plugin!",
+ "name": "Sample Plugin",
+ "version": "1.0.0",
+ "description": "Has an id that violates the required pattern.",
+ "author": {
+ "name": "Jane Doe"
+ },
+ "license": "MIT",
+ "engine": {
+ "termix": ">=2.9.0",
+ "api": "1"
+ },
+ "capabilities": {
+ "backend": true,
+ "frontend": true,
+ "electron": false,
+ "platforms": ["linux"]
+ },
+ "permissions": [],
+ "sidecars": []
+}
diff --git a/scripts/__fixtures__/manifests/invalid-missing-field.json b/scripts/__fixtures__/manifests/invalid-missing-field.json
new file mode 100644
index 000000000..7688463c0
--- /dev/null
+++ b/scripts/__fixtures__/manifests/invalid-missing-field.json
@@ -0,0 +1,21 @@
+{
+ "id": "sample-plugin",
+ "name": "Sample Plugin",
+ "version": "1.0.0",
+ "author": {
+ "name": "Jane Doe"
+ },
+ "license": "MIT",
+ "engine": {
+ "termix": ">=2.9.0",
+ "api": "1"
+ },
+ "capabilities": {
+ "backend": true,
+ "frontend": true,
+ "electron": false,
+ "platforms": ["linux"]
+ },
+ "permissions": [],
+ "sidecars": []
+}
diff --git a/scripts/__fixtures__/manifests/invalid-unknown-permission.json b/scripts/__fixtures__/manifests/invalid-unknown-permission.json
new file mode 100644
index 000000000..f13bfead3
--- /dev/null
+++ b/scripts/__fixtures__/manifests/invalid-unknown-permission.json
@@ -0,0 +1,22 @@
+{
+ "id": "sample-plugin",
+ "name": "Sample Plugin",
+ "version": "1.0.0",
+ "description": "Requests a permission that is not in the known capability list.",
+ "author": {
+ "name": "Jane Doe"
+ },
+ "license": "MIT",
+ "engine": {
+ "termix": ">=2.9.0",
+ "api": "1"
+ },
+ "capabilities": {
+ "backend": true,
+ "frontend": true,
+ "electron": false,
+ "platforms": ["linux"]
+ },
+ "permissions": ["credentials.read"],
+ "sidecars": []
+}
diff --git a/scripts/__fixtures__/manifests/valid.json b/scripts/__fixtures__/manifests/valid.json
new file mode 100644
index 000000000..20b6f1530
--- /dev/null
+++ b/scripts/__fixtures__/manifests/valid.json
@@ -0,0 +1,43 @@
+{
+ "id": "sample-plugin",
+ "name": "Sample Plugin",
+ "version": "1.0.0",
+ "description": "A sample plugin used for schema validation tests.",
+ "author": {
+ "name": "Jane Doe",
+ "url": "https://example.com"
+ },
+ "license": "MIT",
+ "repository": "https://github.com/example/sample-plugin",
+ "engine": {
+ "termix": ">=2.9.0",
+ "api": "1"
+ },
+ "capabilities": {
+ "backend": true,
+ "frontend": true,
+ "electron": false,
+ "platforms": ["linux", "win32", "darwin"]
+ },
+ "permissions": ["hosts.read", "ui.tab", "ui.rail"],
+ "contributes": {
+ "tabs": [
+ {
+ "id": "sample-plugin-tab",
+ "titleKey": "samplePlugin.tab.title",
+ "icon": "Box",
+ "openFrom": ["rail", "palette"]
+ }
+ ],
+ "settingsPanel": {
+ "titleKey": "samplePlugin.settings.title"
+ },
+ "apiPrefix": "sample"
+ },
+ "dependencies": {
+ "plugins": {
+ "other-plugin": "^1.0.0"
+ }
+ },
+ "sidecars": []
+}
diff --git a/scripts/electron-backend-failure.test.ts b/scripts/electron-backend-failure.test.ts
new file mode 100644
index 000000000..46b5f12ef
--- /dev/null
+++ b/scripts/electron-backend-failure.test.ts
@@ -0,0 +1,62 @@
+import { createRequire } from "node:module";
+import { describe, expect, it } from "vitest";
+
+const require = createRequire(import.meta.url);
+const { classifyBackendFailure } =
+ require("../electron/backend-failure.cjs") as {
+ classifyBackendFailure: (stderr: string) => {
+ reason: string;
+ port: number | null;
+ };
+ };
+
+const EADDRINUSE_STDERR = `[2:50:37 PM] [ERROR] [DB] Port 30001 is already in use. Kill the existing process and retry. [op:http_server_port_conflict]
+Error: listen EADDRINUSE: address already in use :::30001
+ at Server.setupListenHandle [as _listen2] (node:net:2009:16) {
+ code: 'EADDRINUSE',
+ errno: -98,
+ syscall: 'listen',
+ address: '::',
+ port: 30001
+}`;
+
+describe("classifyBackendFailure", () => {
+ // Only reached for exits stopBackendServer() did not ask for, so every
+ // exit is a failure the renderer has to be told about: the process is
+ // gone either way, and nothing ever restarts it.
+ it("identifies a port conflict and the port it happened on", () => {
+ expect(classifyBackendFailure(EADDRINUSE_STDERR)).toEqual({
+ reason: "port-in-use",
+ port: 30001,
+ });
+ });
+
+ it("still reports a port conflict when the buffered stderr lost the numeric port field", () => {
+ expect(
+ classifyBackendFailure(
+ "Error: listen EADDRINUSE: address already in use :::30001",
+ ),
+ ).toEqual({ reason: "port-in-use", port: 30001 });
+ });
+
+ it("falls back to a null port when EADDRINUSE carries no parsable port", () => {
+ expect(classifyBackendFailure("code: 'EADDRINUSE'")).toEqual({
+ reason: "port-in-use",
+ port: null,
+ });
+ });
+
+ it("reports a crash for any other non-zero exit", () => {
+ expect(classifyBackendFailure("TypeError: boom")).toEqual({
+ reason: "crashed",
+ port: null,
+ });
+ });
+
+ it("reports a crash for a signal kill, which leaves no stderr at all", () => {
+ expect(classifyBackendFailure("")).toEqual({
+ reason: "crashed",
+ port: null,
+ });
+ });
+});
diff --git a/scripts/electron-gpu-config.test.ts b/scripts/electron-gpu-config.test.ts
new file mode 100644
index 000000000..32c197c28
--- /dev/null
+++ b/scripts/electron-gpu-config.test.ts
@@ -0,0 +1,36 @@
+import { readFileSync } from "node:fs";
+import { runInNewContext } from "node:vm";
+import ts from "typescript";
+import { expect, it, vi } from "vitest";
+const source = readFileSync(
+ new URL("../electron/main.cjs", import.meta.url),
+ "utf8",
+);
+const ast = ts.createSourceFile(
+ "main.cjs",
+ source,
+ ts.ScriptTarget.Latest,
+ true,
+ ts.ScriptKind.JS,
+);
+const statement = ast.statements.find(
+ (s) =>
+ ts.isIfStatement(s) &&
+ s.thenStatement.getText(ast).includes("app.disableHardwareAcceleration()"),
+);
+it.each([
+ ["linux", undefined, false],
+ ["linux", "1", true],
+ ["linux", "0", false],
+ ["win32", undefined, true],
+])(
+ "applies the startup GPU policy on %s with opt-out %s",
+ (platform, value, expected) => {
+ const disableHardwareAcceleration = vi.fn();
+ runInNewContext(statement!.getText(ast), {
+ process: { platform, env: { ELECTRON_DISABLE_GPU: value } },
+ app: { disableHardwareAcceleration },
+ });
+ expect(disableHardwareAcceleration).toHaveBeenCalledTimes(expected ? 1 : 0);
+ },
+);
diff --git a/scripts/electron-security-boundary.test.ts b/scripts/electron-security-boundary.test.ts
new file mode 100644
index 000000000..58151d9a0
--- /dev/null
+++ b/scripts/electron-security-boundary.test.ts
@@ -0,0 +1,26 @@
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+
+const main = readFileSync("electron/main.cjs", "utf8");
+const preload = readFileSync("electron/preload.js", "utf8");
+
+describe("Electron security boundary", () => {
+ it("keeps the renderer sandbox and browser security enabled", () => {
+ expect(main).toContain("sandbox: true");
+ expect(main).toContain("webSecurity: true");
+ expect(main).toContain("allowRunningInsecureContent: false");
+ expect(main).toContain("webviewTag: false");
+ });
+
+ it("does not expose an unrestricted IPC invoke primitive", () => {
+ expect(preload).toContain("invoke: invokeAllowed");
+ expect(preload).not.toContain(
+ "invoke: (channel, ...args) => ipcRenderer.invoke(channel, ...args)",
+ );
+ });
+
+ it("allows the renderer to hand the local session to Remote Sync", () => {
+ expect(main).toContain('ipcMain.handle("notify-local-login"');
+ expect(preload).toContain('"notify-local-login"');
+ });
+});
diff --git a/scripts/generate-dialect-schema.cjs b/scripts/generate-dialect-schema.cjs
index 171279d91..c988fcd68 100644
--- a/scripts/generate-dialect-schema.cjs
+++ b/scripts/generate-dialect-schema.cjs
@@ -171,8 +171,8 @@ function transform(source, dialect) {
);
const imports = isPg
- ? `import {\n pgTable,\n text,\n varchar,\n integer,\n serial,\n boolean,\n doublePrecision,\n index,\n uniqueIndex,\n type AnyPgColumn,\n} from "drizzle-orm/pg-core";`
- : `import {\n mysqlTable,\n text,\n varchar,\n int,\n boolean,\n double,\n index,\n uniqueIndex,\n type AnyMySqlColumn,\n} from "drizzle-orm/mysql-core";`;
+ ? `import {\n pgTable,\n text,\n varchar,\n integer,\n serial,\n boolean,\n doublePrecision,\n index,\n uniqueIndex,\n foreignKey,\n type AnyPgColumn,\n} from "drizzle-orm/pg-core";`
+ : `import {\n mysqlTable,\n text,\n varchar,\n int,\n boolean,\n double,\n index,\n uniqueIndex,\n foreignKey,\n type AnyMySqlColumn,\n} from "drizzle-orm/mysql-core";`;
out = out.replace(
/import\s*\{[^}]*\}\s*from\s*"drizzle-orm\/sqlite-core";/,
diff --git a/scripts/install-macos-sharp.cjs b/scripts/install-macos-sharp.cjs
new file mode 100644
index 000000000..9dc345661
--- /dev/null
+++ b/scripts/install-macos-sharp.cjs
@@ -0,0 +1,27 @@
+const fs = require("node:fs");
+const path = require("node:path");
+const { execFileSync } = require("node:child_process");
+
+function findPackage(start) {
+ let directory = path.dirname(start);
+ while (directory !== path.dirname(directory)) {
+ const manifest = path.join(directory, "package.json");
+ if (fs.existsSync(manifest)) return JSON.parse(fs.readFileSync(manifest));
+ directory = path.dirname(directory);
+ }
+ throw new Error("Could not locate the installed sharp package manifest");
+}
+
+const sharpPackage = findPackage(require.resolve("sharp"));
+const packages = [
+ "@img/sharp-darwin-arm64",
+ "@img/sharp-darwin-x64",
+ "@img/sharp-libvips-darwin-arm64",
+ "@img/sharp-libvips-darwin-x64",
+].map((name) => `${name}@${sharpPackage.optionalDependencies[name]}`);
+
+execFileSync(
+ process.platform === "win32" ? "npm.cmd" : "npm",
+ ["install", "--force", "--no-save", ...packages],
+ { stdio: "inherit" },
+);
diff --git a/scripts/patch-guacamole-lite.cjs b/scripts/patch-guacamole-lite.cjs
index c3d37bce6..28f152f11 100644
--- a/scripts/patch-guacamole-lite.cjs
+++ b/scripts/patch-guacamole-lite.cjs
@@ -25,11 +25,20 @@ const clientConnectionPath = path.join(
"lib",
"ClientConnection.js",
);
+const serverPath = path.join(
+ __dirname,
+ "..",
+ "node_modules",
+ "guacamole-lite",
+ "lib",
+ "Server.js",
+);
if (
!fs.existsSync(guacdClientPath) ||
!fs.existsSync(cryptPath) ||
- !fs.existsSync(clientConnectionPath)
+ !fs.existsSync(clientConnectionPath) ||
+ !fs.existsSync(serverPath)
) {
console.log("[patch-guacamole-lite] File not found, skipping");
process.exit(0);
@@ -52,6 +61,7 @@ function missingAnchor(patch) {
let guacdClientContent = fs.readFileSync(guacdClientPath, "utf8");
let cryptContent = fs.readFileSync(cryptPath, "utf8");
let clientConnectionContent = fs.readFileSync(clientConnectionPath, "utf8");
+let serverContent = fs.readFileSync(serverPath, "utf8");
// Patch 1: protocol version negotiation.
// guacamole-lite originally only accepted 1.0.0/1.1.0. Support the protocol
@@ -358,6 +368,27 @@ if (!clientConnectionContent.includes("compiledSettings.readOnly")) {
patched = true;
}
+// Patch 9: ClientConnection closes malformed-token WebSockets in its
+// constructor, but Server.newConnection still called connect() afterwards.
+// That dereferenced the absent connection settings and turned one bad token
+// into an unhandled rejection that could terminate the backend process.
+const oldConnectionSetup =
+ " newConnection.on('ready', async (clientConnection) => {";
+const newConnectionSetup =
+ " if (!newConnection.connectionSettings || !newConnection.connectionSettings.connection) {\n" +
+ " return;\n" +
+ " }\n" +
+ "\n" +
+ oldConnectionSetup;
+
+if (!serverContent.includes("!newConnection.connectionSettings.connection")) {
+ if (!serverContent.includes(oldConnectionSetup)) {
+ missingAnchor("invalid-token connection guard");
+ }
+ serverContent = serverContent.replace(oldConnectionSetup, newConnectionSetup);
+ patched = true;
+}
+
if (!patched) {
console.log("[patch-guacamole-lite] Already patched");
process.exit(0);
@@ -366,6 +397,7 @@ if (!patched) {
fs.writeFileSync(guacdClientPath, guacdClientContent);
fs.writeFileSync(cryptPath, cryptContent);
fs.writeFileSync(clientConnectionPath, clientConnectionContent);
+fs.writeFileSync(serverPath, serverContent);
console.log(
- "[patch-guacamole-lite] Patched protocol VERSION_1_3_0/1_5_0 support, name handshake, required arguments, UTF-8 token decrypt, and read-only join input filtering",
+ "[patch-guacamole-lite] Patched protocol negotiation, name handshake, required arguments, UTF-8 token decrypt, read-only joins, and malformed-token handling",
);
diff --git a/scripts/patch-guacamole-lite.test.ts b/scripts/patch-guacamole-lite.test.ts
index 70e3ad33d..058928bdf 100644
--- a/scripts/patch-guacamole-lite.test.ts
+++ b/scripts/patch-guacamole-lite.test.ts
@@ -5,6 +5,7 @@ import { describe, expect, it, vi } from "vitest";
const require = createRequire(import.meta.url);
const GuacdClient = require("../node_modules/guacamole-lite/lib/GuacdClient.js");
+const GuacamoleLite = require("../node_modules/guacamole-lite/lib/Server.js");
type PatchedGuacdClient = {
connectionSettings: Record;
@@ -26,6 +27,50 @@ function createPatchedClient(
}
describe("patch-guacamole-lite", () => {
+ it("rejects a malformed token without starting or retaining a connection", async () => {
+ const server = Object.assign(Object.create(GuacamoleLite.prototype), {
+ connectionsCount: 0,
+ clientOptions: {
+ crypt: {
+ cypher: "AES-256-CBC",
+ key: Buffer.alloc(32, 7),
+ },
+ log: {
+ level: 0,
+ stdLog: vi.fn(),
+ errorLog: vi.fn(),
+ },
+ },
+ callbacks: {
+ processConnectionSettings: vi.fn(),
+ },
+ extractGuacdOptions: vi.fn(async () => ({
+ guacdOptions: { host: "127.0.0.1", port: 4822 },
+ connectionInfo: null,
+ isJoin: false,
+ targetSessionId: null,
+ })),
+ activeConnections: new Map(),
+ emit: vi.fn(),
+ });
+ const webSocket = {
+ OPEN: 1,
+ readyState: 1,
+ send: vi.fn(),
+ close: vi.fn(),
+ on: vi.fn(),
+ removeAllListeners: vi.fn(),
+ };
+
+ await server.newConnection(webSocket, {
+ url: "/guacamole/websocket/?token=not-an-encrypted-token",
+ });
+
+ expect(webSocket.close).toHaveBeenCalledOnce();
+ expect(server.activeConnections.size).toBe(0);
+ expect(server.emit).not.toHaveBeenCalledWith("open", expect.anything());
+ });
+
it("handles guacd dynamic argument requests", () => {
const guacdClientPath = path.join(
process.cwd(),
diff --git a/scripts/patch-node-pty.cjs b/scripts/patch-node-pty.cjs
new file mode 100644
index 000000000..197529a35
--- /dev/null
+++ b/scripts/patch-node-pty.cjs
@@ -0,0 +1,85 @@
+const fs = require("node:fs");
+const path = require("node:path");
+
+const nodePtyDir = path.join(__dirname, "..", "node_modules", "node-pty");
+
+if (!fs.existsSync(nodePtyDir)) {
+ console.log("[patch-node-pty] node-pty not found, skipping");
+ process.exit(0);
+}
+
+const unixTerminalPath = path.join(nodePtyDir, "lib", "unixTerminal.js");
+
+const originalHelperRewrite = [
+ "helperPath = helperPath.replace('app.asar', 'app.asar.unpacked');",
+ "helperPath = helperPath.replace('node_modules.asar', 'node_modules.asar.unpacked');",
+].join("\n");
+
+const patchedHelperRewrite = [
+ "if (!helperPath.includes('app.asar.unpacked')) {",
+ " helperPath = helperPath.replace('app.asar', 'app.asar.unpacked');",
+ "}",
+ "if (!helperPath.includes('node_modules.asar.unpacked')) {",
+ " helperPath = helperPath.replace('node_modules.asar', 'node_modules.asar.unpacked');",
+ "}",
+].join("\n");
+
+function patchUnixTerminalHelperRewrite() {
+ if (!fs.existsSync(unixTerminalPath)) {
+ return false;
+ }
+
+ const source = fs.readFileSync(unixTerminalPath, "utf8");
+ if (source.includes(patchedHelperRewrite)) {
+ return false;
+ }
+ if (!source.includes(originalHelperRewrite)) {
+ return false;
+ }
+
+ fs.writeFileSync(
+ unixTerminalPath,
+ source.replace(originalHelperRewrite, patchedHelperRewrite),
+ );
+ return true;
+}
+
+function chmodSpawnHelpers(rootDir) {
+ const candidates = [
+ path.join(rootDir, "build", "Release", "spawn-helper"),
+ path.join(rootDir, "build", "Debug", "spawn-helper"),
+ path.join(rootDir, "prebuilds", "darwin-arm64", "spawn-helper"),
+ path.join(rootDir, "prebuilds", "darwin-x64", "spawn-helper"),
+ path.join(rootDir, "prebuilds", "linux-x64", "spawn-helper"),
+ path.join(rootDir, "prebuilds", "linux-arm64", "spawn-helper"),
+ path.join(rootDir, "prebuilds", "linux-arm", "spawn-helper"),
+ ];
+
+ let fixed = 0;
+ for (const helper of candidates) {
+ if (!fs.existsSync(helper)) continue;
+ const mode = fs.statSync(helper).mode;
+ if ((mode & 0o111) === 0) {
+ fs.chmodSync(helper, mode | 0o755);
+ fixed += 1;
+ }
+ }
+ return fixed;
+}
+
+const helperRewritePatched = patchUnixTerminalHelperRewrite();
+const helpersChmodded = chmodSpawnHelpers(nodePtyDir);
+
+if (helperRewritePatched) {
+ console.log("[patch-node-pty] Patched unixTerminal helper path rewrite");
+}
+if (helpersChmodded > 0) {
+ console.log(
+ `[patch-node-pty] Restored execute bit on ${helpersChmodded} spawn-helper binary(ies)`,
+ );
+}
+if (!helperRewritePatched && helpersChmodded === 0) {
+ console.log("[patch-node-pty] Already patched or target files not found");
+}
+
+module.exports = { chmodSpawnHelpers, patchUnixTerminalHelperRewrite };
diff --git a/scripts/patch-ssh2-agent.cjs b/scripts/patch-ssh2-agent.cjs
new file mode 100644
index 000000000..5589a6dd1
--- /dev/null
+++ b/scripts/patch-ssh2-agent.cjs
@@ -0,0 +1,34 @@
+const fs = require("node:fs");
+
+const original = ` default: {
+ const req = new AgentInboundRequest(msgType);
+ this[SYM_REQS].push(req);
+ this.failureReply(req);
+ }`;
+const patched = ` default: {
+ const req = new AgentInboundRequest(msgType);
+ this[SYM_REQS].push(req);
+ this.failureReply(req);
+ // Discard the entire unsupported request, including its payload.
+ p += this[SYM_MSGLEN] - 1;
+ }`;
+
+function patchAgentSource(source) {
+ if (source.includes(patched)) return source;
+ if (!source.includes(original)) {
+ throw new Error(
+ "ssh2 agent parser changed; review the unsupported-request patch",
+ );
+ }
+ return source.replace(original, patched);
+}
+
+if (require.main === module) {
+ const target = require.resolve("ssh2/lib/agent.js");
+ const source = fs.readFileSync(target, "utf8");
+ const result = patchAgentSource(source);
+ if (result !== source) fs.writeFileSync(target, result);
+ console.log("[patch-ssh2-agent] Unsupported request payloads are consumed");
+}
+
+module.exports = { patchAgentSource };
diff --git a/scripts/plugin-manifest.schema.json b/scripts/plugin-manifest.schema.json
new file mode 100644
index 000000000..b79023cf1
--- /dev/null
+++ b/scripts/plugin-manifest.schema.json
@@ -0,0 +1,220 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://termix.site/schemas/plugin-manifest.schema.json",
+ "title": "Termix Plugin Manifest",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "id",
+ "name",
+ "version",
+ "description",
+ "author",
+ "license",
+ "engine",
+ "capabilities",
+ "permissions",
+ "sidecars"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "pattern": "^[a-z0-9-]+$",
+ "description": "Unique plugin id, lowercase alphanumeric and hyphens only."
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1
+ },
+ "version": {
+ "type": "string",
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-.]+)?(\\+[0-9A-Za-z-.]+)?$",
+ "description": "Semver version string."
+ },
+ "description": {
+ "type": "string",
+ "minLength": 1
+ },
+ "author": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["name"],
+ "properties": {
+ "name": { "type": "string", "minLength": 1 },
+ "url": { "type": "string", "format": "uri" }
+ }
+ },
+ "license": {
+ "type": "string",
+ "minLength": 1
+ },
+ "repository": {
+ "type": "string",
+ "format": "uri"
+ },
+ "engine": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["termix", "api"],
+ "properties": {
+ "termix": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Informational-only Termix version range this plugin targets. Not mechanically enforced."
+ },
+ "api": {
+ "type": "string",
+ "pattern": "^[0-9]+$",
+ "description": "Plugin SDK major version, as a string. The real compatibility gate."
+ }
+ }
+ },
+ "capabilities": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["backend", "frontend", "electron", "platforms"],
+ "properties": {
+ "backend": { "type": "boolean" },
+ "frontend": { "type": "boolean" },
+ "electron": { "type": "boolean" },
+ "platforms": {
+ "type": "array",
+ "items": { "type": "string", "minLength": 1 }
+ }
+ }
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "hosts.read",
+ "hosts.write",
+ "credentials.use",
+ "ssh.exec",
+ "ssh.sftp",
+ "storage.own",
+ "storage.secrets",
+ "network.outbound",
+ "events.read",
+ "notify.send",
+ "users.read",
+ "process.sidecar",
+ "ui.tab",
+ "ui.rail",
+ "ui.card",
+ "ui.settings",
+ "ui.palette"
+ ]
+ }
+ },
+ "contributes": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "tabs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["id", "titleKey", "icon", "openFrom"],
+ "properties": {
+ "id": { "type": "string", "minLength": 1 },
+ "titleKey": { "type": "string", "minLength": 1 },
+ "icon": { "type": "string", "minLength": 1 },
+ "openFrom": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["rail", "host-context-menu", "palette"]
+ },
+ "minItems": 1
+ }
+ }
+ }
+ },
+ "hostCapability": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["key", "labelKey", "editorTab"],
+ "properties": {
+ "key": { "type": "string", "minLength": 1 },
+ "labelKey": { "type": "string", "minLength": 1 },
+ "editorTab": { "type": "string", "minLength": 1 }
+ }
+ },
+ "permissionGroup": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["group", "permissions"],
+ "properties": {
+ "group": { "type": "string", "minLength": 1 },
+ "permissions": {
+ "type": "array",
+ "items": { "type": "string", "minLength": 1 },
+ "minItems": 1
+ },
+ "defaultForRole": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": { "type": "string", "minLength": 1 }
+ }
+ }
+ }
+ },
+ "settingsPanel": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["titleKey"],
+ "properties": {
+ "titleKey": { "type": "string", "minLength": 1 }
+ }
+ },
+ "dashboardCards": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["id", "titleKey"],
+ "properties": {
+ "id": { "type": "string", "minLength": 1 },
+ "titleKey": { "type": "string", "minLength": 1 }
+ }
+ }
+ },
+ "apiPrefix": {
+ "type": "string",
+ "pattern": "^[a-z0-9-]+$",
+ "description": "Mounted at /plugin-api///*."
+ }
+ }
+ },
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "plugins": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Semver range string."
+ }
+ }
+ }
+ },
+ "sidecars": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["id", "binary"],
+ "properties": {
+ "id": { "type": "string", "minLength": 1 },
+ "binary": { "type": "string", "minLength": 1 }
+ }
+ }
+ }
+ }
+}
diff --git a/scripts/validate-plugin-manifest.cjs b/scripts/validate-plugin-manifest.cjs
new file mode 100644
index 000000000..c86bb9948
--- /dev/null
+++ b/scripts/validate-plugin-manifest.cjs
@@ -0,0 +1,225 @@
+/**
+ * Validates a plugin manifest.json against scripts/plugin-manifest.schema.json.
+ *
+ * Hand-rolled rather than pulling in ajv: the schema is small and the checks
+ * that matter (required fields, id pattern, semver, known permissions) are a
+ * handful of straightforward comparisons.
+ *
+ * Usage: node scripts/validate-plugin-manifest.cjs
+ */
+
+const fs = require("fs");
+const path = require("path");
+
+const SCHEMA_PATH = path.join(__dirname, "plugin-manifest.schema.json");
+
+const ID_PATTERN = /^[a-z0-9-]+$/;
+const SEMVER_PATTERN = /^\d+\.\d+\.\d+(-[0-9A-Za-z-.]+)?(\+[0-9A-Za-z-.]+)?$/;
+const API_VERSION_PATTERN = /^[0-9]+$/;
+const OPEN_FROM_VALUES = ["rail", "host-context-menu", "palette"];
+
+function loadSchema() {
+ const raw = fs.readFileSync(SCHEMA_PATH, "utf8");
+ return JSON.parse(raw);
+}
+
+function knownPermissions(schema) {
+ return schema.properties.permissions.items.enum;
+}
+
+function validateManifest(manifest, schema) {
+ const errors = [];
+
+ const requiredTopLevel = schema.required;
+ for (const field of requiredTopLevel) {
+ if (!(field in manifest)) {
+ errors.push(`Missing required field: "${field}"`);
+ }
+ }
+
+ if (typeof manifest.id === "string" && !ID_PATTERN.test(manifest.id)) {
+ errors.push(`Field "id" must match ${ID_PATTERN}, got: "${manifest.id}"`);
+ }
+
+ if (
+ typeof manifest.version === "string" &&
+ !SEMVER_PATTERN.test(manifest.version)
+ ) {
+ errors.push(
+ `Field "version" must be valid semver, got: "${manifest.version}"`,
+ );
+ }
+
+ if (manifest.author && typeof manifest.author === "object") {
+ if (!manifest.author.name) {
+ errors.push('Field "author.name" is required');
+ }
+ }
+
+ if (manifest.engine && typeof manifest.engine === "object") {
+ if (!manifest.engine.termix) {
+ errors.push('Field "engine.termix" is required');
+ }
+ if (!API_VERSION_PATTERN.test(String(manifest.engine.api))) {
+ errors.push(
+ `Field "engine.api" must be an integer-as-string, got: "${manifest.engine.api}"`,
+ );
+ }
+ }
+
+ if (manifest.capabilities && typeof manifest.capabilities === "object") {
+ for (const field of ["backend", "frontend", "electron"]) {
+ if (typeof manifest.capabilities[field] !== "boolean") {
+ errors.push(`Field "capabilities.${field}" must be a boolean`);
+ }
+ }
+ if (!Array.isArray(manifest.capabilities.platforms)) {
+ errors.push('Field "capabilities.platforms" must be an array');
+ }
+ }
+
+ const known = knownPermissions(schema);
+ if (Array.isArray(manifest.permissions)) {
+ for (const permission of manifest.permissions) {
+ if (!known.includes(permission)) {
+ errors.push(
+ `Unknown permission: "${permission}". Known values: ${known.join(", ")}`,
+ );
+ }
+ }
+ } else if ("permissions" in manifest) {
+ errors.push('Field "permissions" must be an array');
+ }
+
+ if (Array.isArray(manifest.sidecars)) {
+ manifest.sidecars.forEach((sidecar, index) => {
+ if (!sidecar || typeof sidecar !== "object") {
+ errors.push(`sidecars[${index}] must be an object`);
+ return;
+ }
+ if (!sidecar.id) errors.push(`sidecars[${index}].id is required`);
+ if (!sidecar.binary) errors.push(`sidecars[${index}].binary is required`);
+ });
+ } else if ("sidecars" in manifest) {
+ errors.push('Field "sidecars" must be an array');
+ }
+
+ if (manifest.contributes && typeof manifest.contributes === "object") {
+ errors.push(...validateContributes(manifest.contributes));
+ }
+
+ return errors;
+}
+
+function validateContributes(contributes) {
+ const errors = [];
+
+ if ("tabs" in contributes) {
+ if (!Array.isArray(contributes.tabs)) {
+ errors.push('Field "contributes.tabs" must be an array');
+ } else {
+ contributes.tabs.forEach((tab, index) => {
+ for (const field of ["id", "titleKey", "icon", "openFrom"]) {
+ if (!(field in (tab || {}))) {
+ errors.push(`contributes.tabs[${index}].${field} is required`);
+ }
+ }
+ if (Array.isArray(tab?.openFrom)) {
+ for (const value of tab.openFrom) {
+ if (!OPEN_FROM_VALUES.includes(value)) {
+ errors.push(
+ `contributes.tabs[${index}].openFrom has unknown value: "${value}"`,
+ );
+ }
+ }
+ }
+ });
+ }
+ }
+
+ if ("hostCapability" in contributes) {
+ for (const field of ["key", "labelKey", "editorTab"]) {
+ if (!(field in (contributes.hostCapability || {}))) {
+ errors.push(`contributes.hostCapability.${field} is required`);
+ }
+ }
+ }
+
+ if ("permissionGroup" in contributes) {
+ const group = contributes.permissionGroup || {};
+ if (!group.group)
+ errors.push("contributes.permissionGroup.group is required");
+ if (!Array.isArray(group.permissions) || group.permissions.length === 0) {
+ errors.push(
+ "contributes.permissionGroup.permissions must be a non-empty array",
+ );
+ }
+ }
+
+ if ("settingsPanel" in contributes) {
+ if (!contributes.settingsPanel?.titleKey) {
+ errors.push("contributes.settingsPanel.titleKey is required");
+ }
+ }
+
+ if ("dashboardCards" in contributes) {
+ if (!Array.isArray(contributes.dashboardCards)) {
+ errors.push('Field "contributes.dashboardCards" must be an array');
+ } else {
+ contributes.dashboardCards.forEach((card, index) => {
+ for (const field of ["id", "titleKey"]) {
+ if (!(field in (card || {}))) {
+ errors.push(
+ `contributes.dashboardCards[${index}].${field} is required`,
+ );
+ }
+ }
+ });
+ }
+ }
+
+ return errors;
+}
+
+function main() {
+ const manifestPath = process.argv[2];
+ if (!manifestPath) {
+ console.error(
+ "Usage: node scripts/validate-plugin-manifest.cjs ",
+ );
+ process.exit(1);
+ }
+
+ const resolvedPath = path.resolve(manifestPath);
+ if (!fs.existsSync(resolvedPath)) {
+ console.error(`Manifest not found: ${resolvedPath}`);
+ process.exit(1);
+ }
+
+ let manifest;
+ try {
+ manifest = JSON.parse(fs.readFileSync(resolvedPath, "utf8"));
+ } catch (err) {
+ console.error(`Manifest is not valid JSON: ${err.message}`);
+ process.exit(1);
+ }
+
+ const schema = loadSchema();
+ const errors = validateManifest(manifest, schema);
+
+ if (errors.length > 0) {
+ console.error(`Invalid plugin manifest: ${resolvedPath}`);
+ for (const error of errors) {
+ console.error(` - ${error}`);
+ }
+ process.exit(1);
+ }
+
+ console.log(`Valid plugin manifest: ${resolvedPath}`);
+}
+
+if (require.main === module) {
+ main();
+}
+
+module.exports = { validateManifest, loadSchema };
diff --git a/scripts/validate-plugin-manifest.test.ts b/scripts/validate-plugin-manifest.test.ts
new file mode 100644
index 000000000..7c8def76b
--- /dev/null
+++ b/scripts/validate-plugin-manifest.test.ts
@@ -0,0 +1,46 @@
+import { describe, expect, it } from "vitest";
+import { execFileSync } from "node:child_process";
+import path from "node:path";
+
+const VALIDATOR = path.join(__dirname, "validate-plugin-manifest.cjs");
+const FIXTURES = path.join(__dirname, "__fixtures__", "manifests");
+
+function runValidator(fixture: string): { status: number; output: string } {
+ try {
+ const output = execFileSync(
+ "node",
+ [VALIDATOR, path.join(FIXTURES, fixture)],
+ { encoding: "utf8" },
+ );
+ return { status: 0, output };
+ } catch (err) {
+ const error = err as { status: number; stdout: string; stderr: string };
+ return { status: error.status, output: error.stdout + error.stderr };
+ }
+}
+
+describe("validate-plugin-manifest.cjs", () => {
+ it("accepts a valid manifest", () => {
+ const { status, output } = runValidator("valid.json");
+ expect(status).toBe(0);
+ expect(output).toContain("Valid plugin manifest");
+ });
+
+ it("rejects a manifest missing a required field", () => {
+ const { status, output } = runValidator("invalid-missing-field.json");
+ expect(status).not.toBe(0);
+ expect(output).toContain('Missing required field: "description"');
+ });
+
+ it("rejects a manifest with a bad id pattern", () => {
+ const { status, output } = runValidator("invalid-bad-id.json");
+ expect(status).not.toBe(0);
+ expect(output).toMatch(/Field "id" must match/);
+ });
+
+ it("rejects a manifest with an unknown permission", () => {
+ const { status, output } = runValidator("invalid-unknown-permission.json");
+ expect(status).not.toBe(0);
+ expect(output).toContain('Unknown permission: "credentials.read"');
+ });
+});
diff --git a/scripts/verify-macos-sharp.cjs b/scripts/verify-macos-sharp.cjs
new file mode 100644
index 000000000..d026473ba
--- /dev/null
+++ b/scripts/verify-macos-sharp.cjs
@@ -0,0 +1,160 @@
+const fs = require("node:fs");
+const os = require("node:os");
+const path = require("node:path");
+const { execFileSync, spawnSync } = require("node:child_process");
+
+const architectures = {
+ x64: ["x64"],
+ arm64: ["arm64"],
+ universal: ["x64", "arm64"],
+};
+
+function expectedArchitecture(artifact) {
+ const name = path.basename(artifact);
+ if (name.includes("_x64_")) return "x64";
+ if (name.includes("_arm64_")) return "arm64";
+ if (name.includes("_universal_")) return "universal";
+ throw new Error(`Cannot determine architecture from artifact name: ${name}`);
+}
+
+function findApp(root) {
+ const pending = [root];
+ while (pending.length) {
+ const current = pending.pop();
+ for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
+ const candidate = path.join(current, entry.name);
+ if (entry.isDirectory() && entry.name.endsWith(".app")) return candidate;
+ if (entry.isDirectory()) pending.push(candidate);
+ }
+ }
+ throw new Error(`No .app bundle found below ${root}`);
+}
+
+function containsFile(root, suffix) {
+ const pending = [root];
+ while (pending.length) {
+ const current = pending.pop();
+ for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
+ const candidate = path.join(current, entry.name);
+ if (entry.isDirectory()) pending.push(candidate);
+ if (entry.isFile() && entry.name.endsWith(suffix)) return true;
+ }
+ }
+ return false;
+}
+
+// electron-builder's mac config sets mergeASARs: false, so a universal build
+// isn't a single merged app.asar. @electron/universal instead ships two full
+// copies side by side (app-x64.asar[.unpacked] and app-arm64.asar[.unpacked])
+// with a small chooser entrypoint that picks one at runtime based on
+// process.arch. A plain (non-universal) build still has one app.asar.unpacked.
+function unpackedModulesDir(app, arch, architecture) {
+ const resources = path.join(app, "Contents/Resources");
+ if (architecture === "universal") {
+ return path.join(resources, `app-${arch}.asar.unpacked/node_modules`);
+ }
+ return path.join(resources, "app.asar.unpacked/node_modules");
+}
+
+function verifyApp(app, architecture, runtimeCheck) {
+ for (const arch of architectures[architecture]) {
+ const modules = unpackedModulesDir(app, arch, architecture);
+ for (const [packageName, nativeSuffix] of [
+ [`sharp-darwin-${arch}`, ".node"],
+ [`sharp-libvips-darwin-${arch}`, ".dylib"],
+ ]) {
+ const packagePath = path.join(modules, "@img", packageName);
+ if (
+ !fs.existsSync(packagePath) ||
+ !containsFile(packagePath, nativeSuffix)
+ ) {
+ throw new Error(
+ `${path.basename(app)} is missing the native binary from @img/${packageName}`,
+ );
+ }
+ }
+ }
+
+ if (!runtimeCheck) return;
+
+ const executable = path.join(app, "Contents/MacOS/Termix");
+ const smoke = [
+ "const sharp = require(process.argv[1]);",
+ "sharp({create:{width:1,height:1,channels:4,background:'#000'}})",
+ ".png().toBuffer().then(() => process.exit(0)).catch(e => { console.error(e); process.exit(1); });",
+ ].join("");
+
+ for (const arch of architectures[architecture]) {
+ const modules = unpackedModulesDir(app, arch, architecture);
+ const sharpPath = path.join(modules, "sharp");
+ const result = spawnSync(
+ "arch",
+ [
+ arch === "x64" ? "-x86_64" : "-arm64",
+ executable,
+ "-e",
+ smoke,
+ sharpPath,
+ ],
+ {
+ encoding: "utf8",
+ env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
+ },
+ );
+ if (result.status !== 0) {
+ throw new Error(
+ `${path.basename(app)} failed the ${arch} sharp runtime smoke test:\n${result.stderr || result.stdout}`,
+ );
+ }
+ }
+}
+
+function verifyArtifact(artifact) {
+ const architecture = expectedArchitecture(artifact);
+ const temporaryRoot = fs.mkdtempSync(path.join(os.tmpdir(), "termix-sharp-"));
+ let mountedAt;
+
+ try {
+ if (artifact.endsWith(".dmg")) {
+ mountedAt = path.join(temporaryRoot, "mounted");
+ fs.mkdirSync(mountedAt);
+ execFileSync("hdiutil", [
+ "attach",
+ artifact,
+ "-readonly",
+ "-nobrowse",
+ "-mountpoint",
+ mountedAt,
+ ]);
+ verifyApp(findApp(mountedAt), architecture, true);
+ } else if (artifact.endsWith(".pkg")) {
+ const expanded = path.join(temporaryRoot, "expanded");
+ execFileSync("pkgutil", ["--expand-full", artifact, expanded]);
+ verifyApp(findApp(expanded), architecture, false);
+ } else {
+ throw new Error(`Unsupported macOS artifact: ${artifact}`);
+ }
+ console.log(`Verified macOS sharp packaging: ${path.basename(artifact)}`);
+ } finally {
+ if (mountedAt) {
+ spawnSync("hdiutil", ["detach", mountedAt], { stdio: "ignore" });
+ }
+ fs.rmSync(temporaryRoot, { recursive: true, force: true });
+ }
+}
+
+module.exports = { expectedArchitecture, verifyApp };
+
+if (require.main === module) {
+ if (process.platform !== "darwin") {
+ throw new Error("macOS sharp artifact verification must run on macOS");
+ }
+ if (process.argv.length < 3) {
+ throw new Error(
+ "Usage: node scripts/verify-macos-sharp.cjs [...]",
+ );
+ }
+
+ for (const artifact of process.argv.slice(2))
+ verifyArtifact(path.resolve(artifact));
+}
diff --git a/scripts/verify-macos-sharp.test.ts b/scripts/verify-macos-sharp.test.ts
new file mode 100644
index 000000000..b0f5292dc
--- /dev/null
+++ b/scripts/verify-macos-sharp.test.ts
@@ -0,0 +1,74 @@
+import fs from "node:fs";
+import { createRequire } from "node:module";
+import os from "node:os";
+import path from "node:path";
+import { afterEach, describe, expect, it } from "vitest";
+
+const require = createRequire(import.meta.url);
+const { expectedArchitecture, verifyApp } = require("./verify-macos-sharp.cjs");
+
+const temporaryDirectories: string[] = [];
+
+// A universal build has mergeASARs: false, so @electron/universal ships
+// app-x64.asar.unpacked and app-arm64.asar.unpacked side by side instead of
+// a single app.asar.unpacked. A plain x64/arm64-only build only ever has one.
+function createApp(architectures: string[], universal = false) {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "termix-sharp-test-"));
+ temporaryDirectories.push(root);
+ const app = path.join(root, "Termix.app");
+
+ for (const architecture of architectures) {
+ const unpackedDir = universal
+ ? `app-${architecture}.asar.unpacked`
+ : "app.asar.unpacked";
+ const modules = path.join(
+ app,
+ `Contents/Resources/${unpackedDir}/node_modules/@img`,
+ );
+ const sharp = path.join(modules, `sharp-darwin-${architecture}/lib`);
+ const libvips = path.join(
+ modules,
+ `sharp-libvips-darwin-${architecture}/lib`,
+ );
+ fs.mkdirSync(sharp, { recursive: true });
+ fs.mkdirSync(libvips, { recursive: true });
+ fs.writeFileSync(path.join(sharp, `sharp-darwin-${architecture}.node`), "");
+ fs.writeFileSync(path.join(libvips, "libvips.dylib"), "");
+ }
+
+ return app;
+}
+
+afterEach(() => {
+ for (const directory of temporaryDirectories.splice(0)) {
+ fs.rmSync(directory, { recursive: true, force: true });
+ }
+});
+
+describe("macOS sharp artifact verification", () => {
+ it("derives the expected architecture from artifact names", () => {
+ expect(expectedArchitecture("termix_macos_x64_dmg.dmg")).toBe("x64");
+ expect(expectedArchitecture("termix_macos_arm64_dmg.dmg")).toBe("arm64");
+ expect(expectedArchitecture("termix_macos_universal_mas.pkg")).toBe(
+ "universal",
+ );
+ });
+
+ it("accepts a universal app with both sharp architectures", () => {
+ expect(() =>
+ verifyApp(createApp(["x64", "arm64"], true), "universal", false),
+ ).not.toThrow();
+ });
+
+ it("rejects a universal app missing one architecture's sharp binaries", () => {
+ expect(() =>
+ verifyApp(createApp(["arm64"], true), "universal", false),
+ ).toThrow(/sharp-darwin-x64/);
+ });
+
+ it("rejects an x64 app containing only arm64 sharp binaries", () => {
+ expect(() => verifyApp(createApp(["arm64"]), "x64", false)).toThrow(
+ /sharp-darwin-x64/,
+ );
+ });
+});
diff --git a/scripts/web-endpoint-certificate-allowlist.test.ts b/scripts/web-endpoint-certificate-allowlist.test.ts
new file mode 100644
index 000000000..feff1abf1
--- /dev/null
+++ b/scripts/web-endpoint-certificate-allowlist.test.ts
@@ -0,0 +1,79 @@
+import { readFileSync } from "node:fs";
+import path from "node:path";
+import { describe, expect, it } from "vitest";
+
+/**
+ * main.cjs is CommonJS Electron main-process code that cannot be imported into
+ * the test environment, so these assert on its source. Coarse by necessity --
+ * but each one pins a property that was a deliberate decision, and would
+ * otherwise be undone by a well-meaning simplification with nothing to object.
+ */
+const source = readFileSync(path.resolve("electron/main.cjs"), "utf8");
+
+describe("web endpoint certificate allowlist", () => {
+ it("is kept out of isInvalidCertificateAllowedForUrl", () => {
+ // That function ALSO feeds getTlsVerificationOptions, which governs main's
+ // own outbound TLS. Widening it would grant far more privilege than
+ // suppressing a certificate error inside one iframe needs.
+ const fn = source.slice(
+ source.indexOf("function isInvalidCertificateAllowedForUrl"),
+ );
+ const body = fn.slice(0, fn.indexOf("\n}"));
+ expect(body).not.toContain("webEndpointCertificateAllowlist");
+ expect(body).not.toContain("isWebEndpointCertificateAllowed");
+ });
+
+ it("is consulted from the certificate-error handler", () => {
+ const handler = source.slice(
+ source.indexOf('app.on(\n "certificate-error"'),
+ );
+ expect(handler.slice(0, 1200)).toContain("isWebEndpointCertificateAllowed");
+ });
+
+ it("accepts https only, in both the check and the handler", () => {
+ // A non-TLS origin in a TLS-error allowlist is meaningless, and file:/ftp:
+ // must never be storable.
+ const check = source.slice(
+ source.indexOf("function isWebEndpointCertificateAllowed"),
+ );
+ expect(check.slice(0, 700)).toContain('parsed.protocol !== "https:"');
+
+ const handler = source.slice(
+ source.indexOf('ipcMain.handle("allow-invalid-certificate-for-origin"'),
+ );
+ expect(handler.slice(0, 800)).toContain('parsed.protocol !== "https:"');
+ });
+
+ it("expires entries rather than holding them until restart", () => {
+ // Main cannot verify the renderer's claim that an origin is a configured
+ // endpoint, so the residual risk must be a momentary window, not an
+ // indefinite one.
+ expect(source).toContain("WEB_ENDPOINT_CERTIFICATE_ALLOWLIST_TTL_MS");
+ const check = source.slice(
+ source.indexOf("function isWebEndpointCertificateAllowed"),
+ );
+ expect(check.slice(0, 700)).toContain("Date.now() >= expiresAt");
+ });
+
+ it("stores the parsed origin, never the caller's string", () => {
+ // Otherwise a path or a wildcard in the supplied value could widen the
+ // allowance beyond one exact origin.
+ const handler = source.slice(
+ source.indexOf('ipcMain.handle("allow-invalid-certificate-for-origin"'),
+ );
+ const body = handler.slice(0, 800);
+ expect(body).toContain(
+ "webEndpointCertificateAllowlist.set(\n parsed.origin,",
+ );
+ });
+
+ it("is reachable from the renderer through the preload allowlist", () => {
+ const preload = readFileSync(path.resolve("electron/preload.js"), "utf8");
+ const allowlist = preload.slice(
+ preload.indexOf("const ALLOWED_INVOKE_CHANNELS"),
+ );
+ expect(allowlist.slice(0, allowlist.indexOf("]"))).toContain(
+ "allow-invalid-certificate-for-origin",
+ );
+ });
+});
diff --git a/src/backend/ai/egress.ts b/src/backend/ai/egress.ts
index 700b11ce9..c2be8aeb3 100644
--- a/src/backend/ai/egress.ts
+++ b/src/backend/ai/egress.ts
@@ -51,8 +51,7 @@ function normalizeHost(hostname: string): string {
/**
* True when the URL names a destination the SSRF guard would refuse. A bare
* hostname that is not an IP literal (e.g. "ollama.internal") is treated as
- * private only if it is "localhost" -- anything else resolves through DNS and
- * is caught at connect time by the guard instead.
+ * private only if it is "localhost" -- anything else needs DNS resolution.
*/
export function isPrivateDestination(rawUrl: string): boolean {
let url: URL;
@@ -98,12 +97,18 @@ export function evaluateEgress(
const host = normalizeHost(url.hostname);
const isPrivate = isPrivateDestination(rawUrl);
+ const normalized = allowlist.map((entry) => entry.trim().toLowerCase());
+
+ // An explicitly allowlisted hostname may resolve to a private address. It
+ // must use the private fetch path; sending it through safeOutboundFetch
+ // would reject it after DNS resolution and make hostname allowlist entries
+ // ineffective. Only administrators can write this list.
+ if (normalized.includes(host)) {
+ return { allowed: true, isPrivate: true };
+ }
if (!isPrivate) return { allowed: true, isPrivate: false };
- const normalized = allowlist.map((entry) => entry.trim().toLowerCase());
- if (normalized.includes(host)) return { allowed: true, isPrivate: true };
-
return {
allowed: false,
isPrivate: true,
diff --git a/src/backend/ai/index.ts b/src/backend/ai/index.ts
index aa31f605b..364ddc6fe 100644
--- a/src/backend/ai/index.ts
+++ b/src/backend/ai/index.ts
@@ -1,6 +1,7 @@
import { getErrorMessage } from "../utils/error-message.js";
import express from "express";
import type { AuthenticatedRequest } from "../../types/index.js";
+import { PermissionManager } from "../utils/permission-manager.js";
import { AuthManager } from "../utils/auth-manager.js";
import { databaseLogger } from "../utils/logger.js";
import {
@@ -36,6 +37,7 @@ import { applyProposal } from "./tools/executor.js";
const router = express.Router();
const authManager = AuthManager.getInstance();
+const permissionManager = PermissionManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
const requireDataAccess = authManager.createDataAccessMiddleware();
const aiGate = createAiGate();
@@ -97,6 +99,7 @@ router.get("/status", authenticateJWT, async (req, res) => {
router.get(
"/providers",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -147,6 +150,7 @@ router.get(
router.post(
"/providers",
authenticateJWT,
+ permissionManager.requirePermission("ai.manage_providers"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -224,6 +228,7 @@ router.post(
router.patch(
"/providers/:id",
authenticateJWT,
+ permissionManager.requirePermission("ai.manage_providers"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -286,6 +291,7 @@ router.patch(
router.delete(
"/providers/:id",
authenticateJWT,
+ permissionManager.requirePermission("ai.manage_providers"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -358,6 +364,7 @@ router.delete(
router.post(
"/probe-models",
authenticateJWT,
+ permissionManager.requirePermission("ai.manage_providers"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -423,6 +430,7 @@ router.post(
router.get(
"/providers/:id/models",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -470,6 +478,7 @@ router.get(
router.get(
"/conversations",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -510,6 +519,7 @@ router.get(
router.get(
"/conversations/:id",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -560,6 +570,7 @@ router.get(
router.delete(
"/conversations/:id",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -622,6 +633,7 @@ router.delete(
router.post(
"/chat/stream",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -840,6 +852,7 @@ router.post(
router.post(
"/proposals/:id/apply",
authenticateJWT,
+ permissionManager.requirePermission("ai.apply_proposals"),
requireDataAccess,
aiGate,
async (req, res) => {
@@ -909,6 +922,129 @@ router.post(
},
);
+/**
+ * @openapi
+ * /ai/proposals/{id}/mark-run-in-terminal:
+ * post:
+ * summary: Record that a run_command proposal was executed in an open terminal
+ * description: >
+ * For the terminal-docked assistant only. The command is typed into the
+ * user's already-open SSH session client-side, not re-run over a pooled
+ * connection here; this just marks the proposal applied with the output
+ * the client captured, so the card and the pooled-connection /apply path
+ * stay in sync without running the command twice.
+ * tags:
+ * - AI
+ * parameters:
+ * - in: path
+ * name: id
+ * required: true
+ * schema:
+ * type: integer
+ * requestBody:
+ * required: true
+ * content:
+ * application/json:
+ * schema:
+ * type: object
+ * properties:
+ * hostId:
+ * type: integer
+ * summary:
+ * type: string
+ * responses:
+ * 200:
+ * description: Proposal marked applied.
+ * 400:
+ * description: The proposal is not a run_command proposal, or the hostId does not match.
+ * 404:
+ * description: Proposal not found.
+ */
+router.post(
+ "/proposals/:id/mark-run-in-terminal",
+ authenticateJWT,
+ permissionManager.requirePermission("ai.apply_proposals"),
+ requireDataAccess,
+ aiGate,
+ async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId as string;
+ const id = parseId(req.params.id);
+ if (!id) return res.status(400).json({ error: "Invalid proposal id" });
+
+ const { hostId, summary } = req.body ?? {};
+ const resolvedHostId = parseId(hostId);
+ if (!resolvedHostId) {
+ return res.status(400).json({ error: "hostId is required" });
+ }
+
+ const repository = createCurrentAiRepository();
+
+ try {
+ const stored = await repository.findProposal(id, userId);
+ if (!stored) return res.status(404).json({ error: "Proposal not found" });
+ if (stored.kind !== "propose_run_command") {
+ return res
+ .status(400)
+ .json({ error: "Only run_command proposals can be marked this way" });
+ }
+ if (stored.status !== "pending") {
+ return res
+ .status(400)
+ .json({ error: `This proposal was already ${stored.status}` });
+ }
+
+ let payload: Record;
+ try {
+ payload = JSON.parse(stored.payload) as Record;
+ } catch {
+ return res
+ .status(400)
+ .json({ error: "The proposal payload is invalid" });
+ }
+ if (parseId(payload.hostId) !== resolvedHostId) {
+ return res
+ .status(400)
+ .json({ error: "This proposal is for a different host" });
+ }
+
+ const resultSummary =
+ typeof summary === "string" && summary.trim()
+ ? summary.trim().slice(0, 2000)
+ : "Run in the open terminal session";
+ await repository.setProposalStatus(id, userId, "applied", resultSummary);
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "ai_proposal_applied",
+ resourceType: "ai_proposal",
+ resourceId: String(id),
+ resourceName: stored.kind,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ res.json({ success: true, summary: resultSummary });
+ } catch (err) {
+ const message = getErrorMessage(
+ err,
+ "Failed to mark the proposal applied",
+ );
+ databaseLogger.error(
+ "Failed to mark AI proposal applied in terminal",
+ err,
+ {
+ operation: "ai_proposal_mark_run_in_terminal_failed",
+ userId,
+ },
+ );
+ res.status(400).json({ error: message });
+ }
+ },
+);
+
/**
* @openapi
* /ai/proposals/{id}/reject:
@@ -931,6 +1067,7 @@ router.post(
router.post(
"/proposals/:id/reject",
authenticateJWT,
+ permissionManager.requirePermission("ai.use"),
requireDataAccess,
aiGate,
async (req, res) => {
diff --git a/src/backend/ai/providers/http.ts b/src/backend/ai/providers/http.ts
index 6195da866..b3f6b4ebb 100644
--- a/src/backend/ai/providers/http.ts
+++ b/src/backend/ai/providers/http.ts
@@ -1,4 +1,4 @@
-import { getFetchDispatcher } from "../../utils/proxy-agent.js";
+import { fetchWithProxy } from "../../utils/proxy-agent.js";
import { safeOutboundFetch } from "../../utils/safe-outbound-fetch.js";
import { evaluateEgress, readPrivateAllowlist } from "../egress.js";
import { AiProviderError } from "./types.js";
@@ -9,8 +9,8 @@ import { AiProviderError } from "./types.js";
*
* Public hosts use safeOutboundFetch, which re-checks the resolved address at
* connect time. Allowlisted private hosts cannot use it (its whole job is to
- * refuse them), so they fall back to plain fetch with the proxy dispatcher --
- * still respecting corporate proxy configuration.
+ * refuse them), so they use the installed Undici fetch implementation with
+ * its matching proxy dispatcher -- still respecting proxy configuration.
*/
export async function providerFetch(
url: string,
@@ -24,10 +24,7 @@ export async function providerFetch(
}
if (decision.isPrivate) {
- return fetch(url, {
- ...init,
- dispatcher: getFetchDispatcher(url),
- } as RequestInit);
+ return fetchWithProxy(url, init);
}
return safeOutboundFetch(url, init) as unknown as Promise;
diff --git a/src/backend/ai/tools/catalog.ts b/src/backend/ai/tools/catalog.ts
index 2edbf55e7..5a13061d3 100644
--- a/src/backend/ai/tools/catalog.ts
+++ b/src/backend/ai/tools/catalog.ts
@@ -5,12 +5,10 @@ import type { AiTool, ToolDefinitionShape } from "./types.js";
/**
* The allowlist, and the security boundary for the whole feature.
*
- * A model can only ever invoke what appears here. This matters more than usual
- * in this codebase: PermissionManager.requirePermission exists but is currently
- * mounted on zero routes, so RBAC strings are a vocabulary for the admin role
- * editor rather than route enforcement. "The assistant cannot reach credentials
- * or user administration" is therefore a property of this list, not of the
- * permission system.
+ * A model can only ever invoke what appears here. Route-level RBAC gates the
+ * HTTP API, but tools run in-process with the calling user's identity and never
+ * pass through a router, so "the assistant cannot reach credentials or user
+ * administration" is a property of this list, not of the permission system.
*
* Anything touching credentials, vaults, RBAC, users, identity, certificates,
* SSO or instance settings is deliberately absent and must stay absent.
@@ -51,6 +49,8 @@ export const FORBIDDEN_DOMAINS = [
"identity",
"certificate",
"opkssh",
+ "stepca",
+ "step_ca",
"acme",
"ssl",
"audit",
diff --git a/src/backend/automations/engine.ts b/src/backend/automations/engine.ts
index 244c1f698..1998ec871 100644
--- a/src/backend/automations/engine.ts
+++ b/src/backend/automations/engine.ts
@@ -267,7 +267,7 @@ export class AutomationEngine {
// its own failure, so the event is not emitted for runs that this event
// already started.
if (request.triggerType !== "internal_event") {
- import("../hosts/metrics/automation-bridge.js")
+ import("../hosts/automation-events.js")
.then(({ notifyAutomationInternalEvent }) =>
notifyAutomationInternalEvent(
"automation_failed",
diff --git a/src/backend/automations/http.ts b/src/backend/automations/http.ts
index db06951b4..569addf49 100644
--- a/src/backend/automations/http.ts
+++ b/src/backend/automations/http.ts
@@ -1,13 +1,14 @@
import { safeOutboundFetch } from "../utils/safe-outbound-fetch.js";
+import { readNotificationPrivateAllowlist } from "../utils/notification-egress.js";
/**
* Outbound HTTP for automation steps and notification channels.
*
* safeOutboundFetch refuses private and loopback addresses, which is the right
* default against SSRF but also blocks the self-hosted ntfy or Gotify sitting
- * on a LAN that many installs actually use. Rather than weaken the guard
- * globally, a destination can opt in explicitly; everything else about the
- * guard (scheme, embedded credentials, no redirects) still applies.
+ * on a LAN that many installs actually use. Private delivery therefore needs
+ * both a channel opt-in and an exact host in the administrator allowlist;
+ * scheme validation, DNS pinning and redirect refusal remain in force.
*/
export interface AutomationFetchOptions {
method?: string;
@@ -52,8 +53,8 @@ export async function automationFetch(
}
/**
- * The opt-in path. Keeps the parts of the guard that are always right and
- * drops only the address blocklist.
+ * The opt-in path still goes through the guarded resolver. Only an exact host
+ * authorized by an administrator may resolve to a private address.
*/
async function privateNetworkFetch(
rawUrl: string,
@@ -73,5 +74,6 @@ async function privateNetworkFetch(
throw new Error("URLs with embedded credentials are not allowed");
}
- return fetch(rawUrl, { ...init, redirect: "error" });
+ const allowlist = await readNotificationPrivateAllowlist();
+ return safeOutboundFetch(rawUrl, init, allowlist);
}
diff --git a/src/backend/database/database.ts b/src/backend/database/database.ts
index d4caec286..cc6275c1a 100644
--- a/src/backend/database/database.ts
+++ b/src/backend/database/database.ts
@@ -17,6 +17,7 @@ import terminalRoutes from "./routes/terminal.js";
import sessionLogRoutes from "./routes/session-log-routes.js";
import guacamoleRoutes from "../hosts/guacamole/routes.js";
import sessionSharingRoutes from "../hosts/session-sharing/routes.js";
+import collabRoutes from "../hosts/collab/routes.js";
import networkTopologyRoutes from "./routes/network-topology.js";
import rbacRoutes from "./routes/rbac.js";
import openTabsRoutes from "./routes/open-tabs.js";
@@ -29,10 +30,12 @@ import termixIdRoutes from "./routes/termix-id.js";
import { registerAuditLogRoutes } from "./routes/audit-log-routes.js";
import { registerTailscaleRoutes } from "./routes/tailscale-routes.js";
import vaultRoutes from "./routes/vault.js";
+import secretSourceRoutes from "./routes/secret-sources.js";
import alertRulesRoutes from "./routes/alert-rules-routes.js";
import aiRoutes from "../ai/index.js";
import automationsRoutes from "./routes/automations.js";
import syncRoutes from "./routes/sync.js";
+import pluginApiRoutes from "./routes/plugin-api-routes.js";
import { createCorsMiddleware } from "../utils/cors-config.js";
import { createCompressionMiddleware } from "../utils/compression-config.js";
import fs from "fs";
@@ -73,7 +76,7 @@ const __dirname = path.dirname(__filename);
const app = express();
-app.set("trust proxy", true);
+app.set("trust proxy", "loopback");
const authManager = AuthManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
@@ -259,9 +262,8 @@ async function fetchGitHubAPI(
}
}
-app.use(bodyParser.json({ limit: "1gb" }));
-app.use(bodyParser.urlencoded({ limit: "1gb", extended: true }));
-app.use(bodyParser.raw({ limit: "5gb", type: "application/octet-stream" }));
+app.use(bodyParser.json({ limit: "2mb" }));
+app.use(bodyParser.urlencoded({ limit: "2mb", extended: true }));
app.use(cookieParser());
app.use((_req, res, next) => {
res.setHeader("Cache-Control", "no-store");
@@ -382,7 +384,7 @@ app.get("/version", authenticateJWT, async (req, res) => {
operation: "version_check",
rawTag,
});
- return res.status(401).send("Remote Version Not Found");
+ return res.json({ localVersion, status: "unknown" });
}
const versionComparison = compareSemver(localVersion, remoteVersion);
@@ -413,7 +415,7 @@ app.get("/version", authenticateJWT, async (req, res) => {
databaseLogger.error("Version check failed", err, {
operation: "version_check",
});
- res.status(500).send("Fetch Error");
+ res.json({ localVersion, status: "unknown" });
}
});
@@ -791,6 +793,7 @@ app.post("/database/export", authenticateJWT, async (req, res) => {
jump_hosts TEXT,
enable_file_manager INTEGER NOT NULL DEFAULT 1,
enable_docker INTEGER NOT NULL DEFAULT 0,
+ enable_web_ui INTEGER NOT NULL DEFAULT 0,
show_terminal_in_sidebar INTEGER NOT NULL DEFAULT 1,
show_file_manager_in_sidebar INTEGER NOT NULL DEFAULT 0,
show_tunnel_in_sidebar INTEGER NOT NULL DEFAULT 0,
@@ -799,6 +802,7 @@ app.post("/database/export", authenticateJWT, async (req, res) => {
default_path TEXT,
stats_config TEXT,
docker_config TEXT,
+ web_ui_config TEXT,
terminal_config TEXT,
quick_actions TEXT,
notes TEXT,
@@ -921,8 +925,8 @@ app.post("/database/export", authenticateJWT, async (req, res) => {
const sshHosts =
await createCurrentHostRepository().listDecryptedByUserId(userId);
const insertHost = exportDb.prepare(`
- INSERT INTO ssh_data (id, user_id, connection_type, name, ip, port, username, folder, tags, pin, auth_type, force_keyboard_interactive, password, key, key_password, key_type, sudo_password, autostart_password, autostart_key, autostart_key_password, credential_id, override_credential_username, enable_terminal, enable_tunnel, tunnel_connections, jump_hosts, enable_file_manager, enable_docker, show_terminal_in_sidebar, show_file_manager_in_sidebar, show_tunnel_in_sidebar, show_docker_in_sidebar, show_server_stats_in_sidebar, default_path, stats_config, docker_config, terminal_config, quick_actions, notes, use_socks5, socks5_host, socks5_port, socks5_username, socks5_password, socks5_proxy_chain, domain, security, ignore_cert, guacamole_config, mac_address, port_knock_sequence, created_at, updated_at)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+ INSERT INTO ssh_data (id, user_id, connection_type, name, ip, port, username, folder, tags, pin, auth_type, force_keyboard_interactive, password, key, key_password, key_type, sudo_password, autostart_password, autostart_key, autostart_key_password, credential_id, override_credential_username, enable_terminal, enable_tunnel, tunnel_connections, jump_hosts, enable_file_manager, enable_docker, enable_web_ui, show_terminal_in_sidebar, show_file_manager_in_sidebar, show_tunnel_in_sidebar, show_docker_in_sidebar, show_server_stats_in_sidebar, default_path, stats_config, docker_config, web_ui_config, terminal_config, quick_actions, notes, use_socks5, socks5_host, socks5_port, socks5_username, socks5_password, socks5_proxy_chain, domain, security, ignore_cert, guacamole_config, mac_address, port_knock_sequence, created_at, updated_at)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
for (const decrypted of sshHosts) {
@@ -955,6 +959,7 @@ app.post("/database/export", authenticateJWT, async (req, res) => {
decrypted.jumpHosts || null,
decrypted.enableFileManager ? 1 : 0,
decrypted.enableDocker ? 1 : 0,
+ decrypted.enableWebUi ? 1 : 0,
decrypted.showTerminalInSidebar ? 1 : 0,
decrypted.showFileManagerInSidebar ? 1 : 0,
decrypted.showTunnelInSidebar ? 1 : 0,
@@ -963,6 +968,7 @@ app.post("/database/export", authenticateJWT, async (req, res) => {
decrypted.defaultPath || null,
decrypted.statsConfig || null,
decrypted.dockerConfig || null,
+ decrypted.webUiConfig || null,
decrypted.terminalConfig || null,
decrypted.quickActions || null,
decrypted.notes || null,
@@ -1753,6 +1759,7 @@ app.use("/terminal", terminalRoutes);
app.use("/session_logs", sessionLogRoutes);
app.use("/guacamole", guacamoleRoutes);
app.use("/session-sharing", sessionSharingRoutes);
+app.use("/collab", collabRoutes);
app.use("/network-topology", networkTopologyRoutes);
app.use("/rbac", rbacRoutes);
app.use("/open-tabs", openTabsRoutes);
@@ -1765,12 +1772,14 @@ app.use("/termix-id", termixIdRoutes);
registerAuditLogRoutes(app, authenticateJWT);
registerTailscaleRoutes(app, authenticateJWT);
app.use("/vault", vaultRoutes);
+app.use("/secret-sources", secretSourceRoutes);
// Before the alert routes, which are mounted at the root and would otherwise
// have first claim on the path.
app.use("/automations", automationsRoutes);
app.use("/ai", aiRoutes);
app.use("/", alertRulesRoutes);
app.use("/sync", syncRoutes);
+app.use("/plugin-api", pluginApiRoutes);
const frontendDistPaths = [
path.join(__dirname, "../../../dist"),
@@ -2035,7 +2044,7 @@ httpServer.on("error", (err: NodeJS.ErrnoException) => {
});
export const serverReady = new Promise((resolve) => {
- httpServer.listen(HTTP_PORT, async () => {
+ httpServer.listen(HTTP_PORT, "127.0.0.1", async () => {
if (!fs.existsSync(uploadsDir)) {
fs.mkdirSync(uploadsDir, { recursive: true });
}
@@ -2084,7 +2093,7 @@ if (
});
});
- httpsServer.listen(sslConfig.port, () => {
+ httpsServer.listen(sslConfig.port, "127.0.0.1", () => {
databaseLogger.success(
`Backend is now also listening for HTTPS directly`,
{
diff --git a/src/backend/database/db/index.ts b/src/backend/database/db/index.ts
index dd4327566..92c74f2c5 100644
--- a/src/backend/database/db/index.ts
+++ b/src/backend/database/db/index.ts
@@ -21,6 +21,7 @@ import {
} from "../../utils/data-dir-guard.js";
import { getDefaultGuacdUrl } from "../../utils/guacd-config.js";
import { resolveDatabaseDialect, type DatabaseDialect } from "./dialect.js";
+import { SYSTEM_ROLE_DEFAULTS } from "../../utils/permission-catalog.js";
import { connectRemoteDatabase } from "./connect.js";
import { runRemoteMigrations } from "./migrate.js";
import type { PortableDatabase } from "../repositories/database-context.js";
@@ -305,6 +306,7 @@ async function initializeCompleteDatabase(): Promise {
tunnel_connections TEXT,
enable_file_manager INTEGER NOT NULL DEFAULT 1,
enable_docker INTEGER NOT NULL DEFAULT 0,
+ enable_web_ui INTEGER NOT NULL DEFAULT 0,
default_path TEXT,
autostart_password TEXT,
autostart_key TEXT,
@@ -312,6 +314,7 @@ async function initializeCompleteDatabase(): Promise {
force_keyboard_interactive TEXT,
stats_config TEXT,
docker_config TEXT,
+ web_ui_config TEXT,
terminal_config TEXT,
notes TEXT,
use_socks5 INTEGER,
@@ -577,6 +580,154 @@ async function initializeCompleteDatabase(): Promise {
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
);
+ CREATE TABLE IF NOT EXISTS collab_rooms (
+ id TEXT PRIMARY KEY,
+ name TEXT NOT NULL,
+ owner_user_id TEXT NOT NULL,
+ persistent INTEGER NOT NULL DEFAULT 0,
+ presenter_user_id TEXT,
+ stage_protocol TEXT,
+ stage_host_id INTEGER,
+ stage_share_id TEXT,
+ guest_link_token TEXT,
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ended_at TEXT,
+ FOREIGN KEY (owner_user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (presenter_user_id) REFERENCES users (id) ON DELETE SET NULL,
+ FOREIGN KEY (stage_host_id) REFERENCES ssh_data (id) ON DELETE SET NULL,
+ FOREIGN KEY (stage_share_id) REFERENCES session_shares (id) ON DELETE SET NULL
+ );
+
+ CREATE TABLE IF NOT EXISTS collab_room_members (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ room_id TEXT NOT NULL,
+ user_id TEXT NOT NULL,
+ room_role TEXT NOT NULL DEFAULT 'member',
+ added_by TEXT,
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE (room_id, user_id),
+ FOREIGN KEY (room_id) REFERENCES collab_rooms (id) ON DELETE CASCADE,
+ FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (added_by) REFERENCES users (id) ON DELETE SET NULL
+ );
+
+ CREATE TABLE IF NOT EXISTS secret_sources (
+ id TEXT PRIMARY KEY,
+ user_id TEXT NOT NULL,
+ name TEXT NOT NULL,
+ kind TEXT NOT NULL DEFAULT 'onepassword-connect',
+ base_url TEXT NOT NULL,
+ token TEXT NOT NULL,
+ shared INTEGER NOT NULL DEFAULT 0,
+ 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
+ );
+
+ CREATE TABLE IF NOT EXISTS credential_access (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ credential_id INTEGER NOT NULL,
+ user_id TEXT,
+ role_id INTEGER,
+ granted_by TEXT NOT NULL,
+ permission_level TEXT NOT NULL DEFAULT 'use',
+ expires_at TEXT,
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (credential_id) REFERENCES ssh_credentials (id) ON DELETE CASCADE,
+ FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE CASCADE,
+ FOREIGN KEY (granted_by) REFERENCES users (id) ON DELETE CASCADE
+ );
+ CREATE INDEX IF NOT EXISTS idx_credential_access_user_id ON credential_access (user_id);
+ CREATE INDEX IF NOT EXISTS idx_credential_access_role_id ON credential_access (role_id);
+ CREATE INDEX IF NOT EXISTS idx_credential_access_credential_id ON credential_access (credential_id);
+
+ CREATE TABLE IF NOT EXISTS shared_credential_secrets (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ credential_access_id INTEGER NOT NULL,
+ target_user_id TEXT NOT NULL,
+ credential_id INTEGER NOT NULL,
+ encrypted_username TEXT,
+ auth_type TEXT NOT NULL DEFAULT 'password',
+ encrypted_password TEXT,
+ encrypted_key TEXT,
+ encrypted_key_password TEXT,
+ key_type TEXT,
+ public_key TEXT,
+ cert_public_key TEXT,
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE (credential_access_id, target_user_id),
+ FOREIGN KEY (credential_access_id) REFERENCES credential_access (id) ON DELETE CASCADE,
+ FOREIGN KEY (target_user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (credential_id) REFERENCES ssh_credentials (id) ON DELETE CASCADE
+ );
+ CREATE INDEX IF NOT EXISTS idx_shared_credential_secrets_target ON shared_credential_secrets (target_user_id, credential_id);
+
+ CREATE TABLE IF NOT EXISTS folder_access (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ owner_user_id TEXT NOT NULL,
+ folder TEXT NOT NULL,
+ user_id TEXT,
+ role_id INTEGER,
+ granted_by TEXT NOT NULL,
+ permission_level TEXT NOT NULL DEFAULT 'connect',
+ expires_at TEXT,
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (owner_user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE,
+ FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE CASCADE,
+ FOREIGN KEY (granted_by) REFERENCES users (id) ON DELETE CASCADE
+ );
+ CREATE INDEX IF NOT EXISTS idx_folder_access_owner_folder ON folder_access (owner_user_id, folder);
+
+ CREATE TABLE IF NOT EXISTS plugins (
+ id TEXT PRIMARY KEY,
+ name TEXT NOT NULL,
+ version TEXT NOT NULL,
+ tier TEXT NOT NULL DEFAULT 'available',
+ source TEXT NOT NULL DEFAULT 'community',
+ registry_id TEXT,
+ state TEXT NOT NULL DEFAULT 'disabled',
+ installed_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ auto_update INTEGER NOT NULL DEFAULT 0,
+ manifest_json TEXT NOT NULL
+ );
+ CREATE INDEX IF NOT EXISTS idx_plugins_registry_id ON plugins (registry_id);
+
+ CREATE TABLE IF NOT EXISTS plugin_permission_grants (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ plugin_id TEXT NOT NULL,
+ capability TEXT NOT NULL,
+ granted_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ granted_by TEXT NOT NULL,
+ UNIQUE (plugin_id, capability),
+ FOREIGN KEY (plugin_id) REFERENCES plugins (id) ON DELETE CASCADE,
+ FOREIGN KEY (granted_by) REFERENCES users (id) ON DELETE CASCADE
+ );
+
+ CREATE TABLE IF NOT EXISTS plugin_registries (
+ id TEXT PRIMARY KEY,
+ name TEXT NOT NULL,
+ url TEXT NOT NULL,
+ kind TEXT NOT NULL DEFAULT 'community',
+ enabled INTEGER NOT NULL DEFAULT 1,
+ signing_key TEXT,
+ last_checked_at TEXT,
+ last_index_hash TEXT
+ );
+
+ CREATE TABLE IF NOT EXISTS plugin_install_counts (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ plugin_id TEXT NOT NULL,
+ registry_id TEXT NOT NULL,
+ count INTEGER NOT NULL DEFAULT 0,
+ source TEXT NOT NULL DEFAULT 'aggregate-telemetry',
+ updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE (plugin_id, registry_id)
+ );
+
CREATE TABLE IF NOT EXISTS api_keys (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
@@ -853,6 +1004,11 @@ const migrateSchema = () => {
"expand_app_rail_on_hover",
"INTEGER",
);
+ addColumnIfNotExists(
+ "user_preferences",
+ "show_pin_app_rail_button",
+ "INTEGER",
+ );
addColumnIfNotExists("user_preferences", "folders_collapsed", "INTEGER");
addColumnIfNotExists("user_preferences", "confirm_snippet_execution", "INTEGER");
addColumnIfNotExists("user_preferences", "disable_update_check", "INTEGER");
@@ -1057,6 +1213,12 @@ const migrateSchema = () => {
"INTEGER NOT NULL DEFAULT 0",
);
addColumnIfNotExists("ssh_data", "docker_config", "TEXT");
+ addColumnIfNotExists(
+ "ssh_data",
+ "enable_web_ui",
+ "INTEGER NOT NULL DEFAULT 0",
+ );
+ addColumnIfNotExists("ssh_data", "web_ui_config", "TEXT");
addColumnIfNotExists(
"ssh_data",
"enable_proxmox",
@@ -1079,6 +1241,11 @@ const migrateSchema = () => {
"enable_terminal_toolbar",
"INTEGER NOT NULL DEFAULT 1",
);
+ addColumnIfNotExists(
+ "ssh_data",
+ "enable_ai_assistant",
+ "INTEGER NOT NULL DEFAULT 0",
+ );
addColumnIfNotExists("ssh_data", "connection_type", 'TEXT NOT NULL DEFAULT "ssh"');
addColumnIfNotExists("ssh_data", "domain", "TEXT");
@@ -1953,20 +2120,24 @@ const migrateSchema = () => {
});
}
- const systemRoles = [
- {
- name: "admin",
- displayName: "rbac.roles.admin",
- description: "Administrator with full access",
- permissions: null,
- },
- {
- name: "user",
- displayName: "rbac.roles.user",
- description: "Regular user",
- permissions: null,
- },
- ];
+ const systemRoles = Object.entries(SYSTEM_ROLE_DEFAULTS).map(
+ ([name, defaults]) => ({
+ name,
+ displayName: `rbac.roles.${name}`,
+ description: defaults.description,
+ permissions: JSON.stringify(defaults.permissions),
+ }),
+ );
+
+ // Route-level RBAC needs the permission lists to exist; roles seeded by
+ // earlier versions carried NULL there. Backfill only NULL so an admin's
+ // edits to these roles are never overwritten.
+ const backfillPermissions = sqlite.prepare(
+ "UPDATE roles SET permissions = ? WHERE name = ? AND is_system = 1 AND permissions IS NULL",
+ );
+ for (const role of systemRoles) {
+ backfillPermissions.run(role.permissions, role.name);
+ }
for (const role of systemRoles) {
const existingRole = sqlite.prepare("SELECT id FROM roles WHERE name = ?").get(role.name);
@@ -2035,6 +2206,10 @@ const migrateSchema = () => {
}
addColumnIfNotExists("users", "sso_provider_id", "INTEGER");
+ addColumnIfNotExists("collab_rooms", "guest_link_token", "TEXT");
+ sqlite.exec(
+ "CREATE UNIQUE INDEX IF NOT EXISTS idx_collab_rooms_guest_token ON collab_rooms (guest_link_token)",
+ );
try {
const usersTableInfo = sqlite.prepare("PRAGMA table_info(users)").all() as Array<{
@@ -2986,6 +3161,12 @@ async function initializeRemoteDatabase(
await primeCurrentSettingsCache();
startSettingsCacheRefresh();
+ // The SQLite bootstrap seeds system roles inline below; migrations for the
+ // remote dialects never did, and route-level RBAC denies a user with no
+ // usable role, so they are seeded (and backfilled) here.
+ const { ensureSystemRoles } = await import("../../utils/system-roles.js");
+ await ensureSystemRoles();
+
databaseLogger.info(`${dialect} database ready`, {
operation: "db_init_complete",
dialect,
diff --git a/src/backend/database/db/schema.mysql.ts b/src/backend/database/db/schema.mysql.ts
index 97253eb02..b382e1e5a 100644
--- a/src/backend/database/db/schema.mysql.ts
+++ b/src/backend/database/db/schema.mysql.ts
@@ -16,6 +16,7 @@ import {
double,
index,
uniqueIndex,
+ foreignKey,
type AnyMySqlColumn,
} from "drizzle-orm/mysql-core";
import { sql } from "drizzle-orm";
@@ -150,7 +151,7 @@ export const hosts = mysqlTable(
ip: text("ip").notNull(),
port: int("port").notNull(),
username: text("username").notNull(),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
// Sub-host nesting: a host acting as an organizational parent for other
// hosts, mutually exclusive with folder (see host route validation).
parentHostId: int("parent_host_id").references(
@@ -212,12 +213,18 @@ export const hosts = mysqlTable(
enableDocker: boolean("enable_docker")
.notNull()
.default(false),
+ enableWebUi: boolean("enable_web_ui")
+ .notNull()
+ .default(false),
enableTmuxMonitor: boolean("enable_tmux_monitor")
.notNull()
.default(false),
enableTerminalToolbar: boolean("enable_terminal_toolbar")
.notNull()
.default(true),
+ enableAiAssistant: boolean("enable_ai_assistant")
+ .notNull()
+ .default(false),
showTerminalInSidebar: boolean("show_terminal_in_sidebar")
.notNull()
.default(true),
@@ -236,6 +243,7 @@ export const hosts = mysqlTable(
defaultPath: text("default_path"),
statsConfig: text("stats_config"),
dockerConfig: text("docker_config"),
+ webUiConfig: text("web_ui_config"),
enableProxmox: boolean("enable_proxmox")
.notNull()
.default(false),
@@ -439,7 +447,7 @@ export const sshCredentials = mysqlTable(
.references(() => users.id, { onDelete: "cascade" }),
name: varchar("name", { length: 255 }).notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
tags: text("tags"),
pin: boolean("pin").notNull().default(false),
// Manual drag-to-reorder position within a folder. Null means the
@@ -505,7 +513,7 @@ export const snippets = mysqlTable(
name: varchar("name", { length: 255 }).notNull(),
content: text("content").notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
order: int("order").notNull().default(0),
syncId: varchar("sync_id", { length: 255 }).unique(),
createdAt: varchar("created_at", { length: 255 })
@@ -1022,7 +1030,7 @@ export const vaultProfiles = mysqlTable("vault_profiles", {
.references(() => users.id, { onDelete: "cascade" }),
name: varchar("name", { length: 255 }).notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
tags: text("tags"),
// Vault server connection (non-secret)
vaultAddr: text("vault_addr").notNull(),
@@ -1136,6 +1144,7 @@ export const userPreferences = mysqlTable("user_preferences", {
hostTrayOnClick: boolean("host_tray_on_click"),
pinAppRail: boolean("pin_app_rail"),
expandAppRailOnHover: boolean("expand_app_rail_on_hover"),
+ showPinAppRailButton: boolean("show_pin_app_rail_button"),
foldersCollapsed: boolean("folders_collapsed"),
confirmSnippetExecution: boolean("confirm_snippet_execution"),
disableUpdateCheck: boolean("disable_update_check"),
@@ -1939,3 +1948,335 @@ export const aiProposals = mysqlTable(
],
);
// --- ai end ---
+
+// --- collab rooms ---
+
+/**
+ * A collaboration room: a group of users watching one "stage" - the live
+ * session the current presenter is showing. The stage points at a
+ * shareType="room" row in session_shares, so transport, gating, recording and
+ * expiry all reuse the session-sharing machinery.
+ */
+export const collabRooms = mysqlTable(
+ "collab_rooms",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ ownerUserId: varchar("owner_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // Persistent rooms survive being emptied and can be re-used; one-off
+ // rooms are ended explicitly and never listed again.
+ persistent: boolean("persistent")
+ .notNull()
+ .default(false),
+
+ presenterUserId: varchar("presenter_user_id", { length: 255 }).references(() => users.id, {
+ onDelete: "set null",
+ }),
+ stageProtocol: text("stage_protocol"),
+ stageHostId: int("stage_host_id").references(() => hosts.id, {
+ onDelete: "set null",
+ }),
+ stageShareId: varchar("stage_share_id", { length: 255 }).references(() => sessionShares.id, {
+ onDelete: "set null",
+ }),
+
+ // Set = anonymous guests may watch the stage through this token.
+ guestLinkToken: varchar("guest_link_token", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ endedAt: text("ended_at"),
+ },
+ (table) => [
+ index("idx_collab_rooms_owner").on(table.ownerUserId),
+ uniqueIndex("idx_collab_rooms_guest_token").on(table.guestLinkToken),
+ ],
+);
+
+export const collabRoomMembers = mysqlTable(
+ "collab_room_members",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ roomId: varchar("room_id", { length: 255 })
+ .notNull()
+ .references(() => collabRooms.id, { onDelete: "cascade" }),
+ userId: varchar("user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // "host" runs the room: invites, force-switches the presenter, ends it.
+ roomRole: text("room_role").notNull().default("member"),
+ addedBy: varchar("added_by", { length: 255 }).references(() => users.id, {
+ onDelete: "set null",
+ }),
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [
+ uniqueIndex("idx_collab_room_members_room_user").on(
+ table.roomId,
+ table.userId,
+ ),
+ index("idx_collab_room_members_user").on(table.userId),
+ ],
+);
+
+// --- secret sources ---
+
+/**
+ * An external password manager Termix pulls secrets from at connect time,
+ * instead of storing them. Only the access token is secret; it is encrypted
+ * with the owner's data key under the row id. Hosts and credentials refer to
+ * entries by reference ("op://vault/item/field") in their secret fields.
+ */
+export const secretSources = mysqlTable(
+ "secret_sources",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ userId: varchar("user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ name: varchar("name", { length: 255 }).notNull(),
+ // "onepassword-connect" for now; the reference syntax is per kind.
+ kind: text("kind").notNull().default("onepassword-connect"),
+ baseUrl: text("base_url").notNull(),
+ token: text("token").notNull(),
+ // Visible to every user; secrets still decrypt with the owner's key.
+ shared: boolean("shared").notNull().default(false),
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [index("idx_secret_sources_user").on(table.userId)],
+);
+
+// --- credential sharing ---
+
+/**
+ * Who may use or manage someone else's credential. Same shape as
+ * snippet_access; "use" attaches it to hosts and connects, "manage" also
+ * edits and re-shares it.
+ */
+export const credentialAccess = mysqlTable(
+ "credential_access",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ credentialId: int("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ userId: varchar("user_id", { length: 255 }).references(() => users.id, { onDelete: "cascade" }),
+ roleId: int("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ permissionLevel: text("permission_level").notNull().default("use"),
+
+ expiresAt: varchar("expires_at", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [
+ index("idx_credential_access_user_id").on(table.userId),
+ index("idx_credential_access_role_id").on(table.roleId),
+ index("idx_credential_access_credential_id").on(table.credentialId),
+ ],
+);
+
+/**
+ * A recipient's copy of a shared credential's secrets, re-encrypted under
+ * the recipient's data key (the owner's key cannot be used by anyone else).
+ * Rebuilt whenever the owner edits the credential; one row per grant and
+ * recipient, like shared_host_secrets.
+ */
+export const sharedCredentialSecrets = mysqlTable(
+ "shared_credential_secrets",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ credentialAccessId: int("credential_access_id").notNull(),
+ targetUserId: varchar("target_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ credentialId: int("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ encryptedUsername: text("encrypted_username"),
+ authType: text("auth_type").notNull().default("password"),
+ encryptedPassword: text("encrypted_password"),
+ encryptedKey: text("encrypted_key"),
+ encryptedKeyPassword: text("encrypted_key_password"),
+ keyType: text("key_type"),
+ publicKey: text("public_key"),
+ certPublicKey: text("cert_public_key"),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [
+ foreignKey({
+ columns: [table.credentialAccessId],
+ foreignColumns: [credentialAccess.id],
+ name: "shared_cred_secrets_access_id_fk",
+ }).onDelete("cascade"),
+ uniqueIndex("idx_shared_credential_secrets_scope").on(
+ table.credentialAccessId,
+ table.targetUserId,
+ ),
+ index("idx_shared_credential_secrets_target").on(
+ table.targetUserId,
+ table.credentialId,
+ ),
+ ],
+);
+
+// --- folder access rules ---
+
+/**
+ * A standing share on a host folder. Sharing a folder fans out host_access
+ * grants to the hosts in it today; this row is what makes hosts created in
+ * or moved into the folder later inherit the same access.
+ */
+export const folderAccess = mysqlTable(
+ "folder_access",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ ownerUserId: varchar("owner_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ // The folder path as stored on hosts ("Parent / Child"); subfolders inherit.
+ folder: varchar("folder", { length: 255 }).notNull(),
+
+ userId: varchar("user_id", { length: 255 }).references(() => users.id, { onDelete: "cascade" }),
+ roleId: int("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ permissionLevel: text("permission_level").notNull().default("connect"),
+ expiresAt: varchar("expires_at", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [
+ index("idx_folder_access_owner_folder").on(table.ownerUserId, table.folder),
+ ],
+);
+
+// --- plugins begin ---
+
+/**
+ * An installed plugin. id matches the manifest's own id (not autoincrement),
+ * so a plugin can be looked up the same way the manifest and registry refer
+ * to it. manifest_json is the full manifest as it was at install time, kept
+ * for audit/rollback even after a registry updates or removes the entry.
+ */
+export const plugins = mysqlTable(
+ "plugins",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ version: text("version").notNull(),
+ tier: text("tier").notNull().default("available"),
+ source: text("source").notNull().default("community"),
+ registryId: varchar("registry_id", { length: 255 }),
+ state: text("state").notNull().default("disabled"),
+ installedAt: text("installed_at")
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ autoUpdate: boolean("auto_update")
+ .notNull()
+ .default(false),
+ manifestJson: text("manifest_json").notNull(),
+ },
+ (table) => [index("idx_plugins_registry_id").on(table.registryId)],
+);
+
+export const pluginPermissionGrants = mysqlTable(
+ "plugin_permission_grants",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ pluginId: varchar("plugin_id", { length: 255 })
+ .notNull()
+ .references(() => plugins.id, { onDelete: "cascade" }),
+ capability: varchar("capability", { length: 255 }).notNull(),
+ grantedAt: text("granted_at")
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ },
+ // A plugin's grants are always read together, and re-granting the same
+ // capability should update the existing row rather than duplicate it.
+ (table) => [
+ uniqueIndex("idx_plugin_permission_grants_plugin_capability").on(
+ table.pluginId,
+ table.capability,
+ ),
+ ],
+);
+
+export const pluginRegistries = mysqlTable("plugin_registries", {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ url: text("url").notNull(),
+ kind: text("kind").notNull().default("community"),
+ enabled: boolean("enabled").notNull().default(true),
+ signingKey: text("signing_key"),
+ lastCheckedAt: text("last_checked_at"),
+ lastIndexHash: text("last_index_hash"),
+});
+
+/**
+ * Install counts populated by a background job (GitHub release download
+ * counts, aggregated telemetry, or a manual override) rather than by the
+ * install/uninstall actions themselves — kept separate from `plugins` so
+ * that job can overwrite counts without touching install state.
+ */
+export const pluginInstallCounts = mysqlTable(
+ "plugin_install_counts",
+ {
+ id: int("id").autoincrement().primaryKey(),
+ pluginId: varchar("plugin_id", { length: 255 }).notNull(),
+ registryId: varchar("registry_id", { length: 255 }).notNull(),
+ count: int("count").notNull().default(0),
+ source: text("source").notNull().default("aggregate-telemetry"),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`(CURRENT_TIMESTAMP)`),
+ },
+ (table) => [
+ uniqueIndex("idx_plugin_install_counts_plugin_registry").on(
+ table.pluginId,
+ table.registryId,
+ ),
+ ],
+);
+
+// --- plugins end ---
diff --git a/src/backend/database/db/schema.pg.ts b/src/backend/database/db/schema.pg.ts
index c5d03273c..3b264803e 100644
--- a/src/backend/database/db/schema.pg.ts
+++ b/src/backend/database/db/schema.pg.ts
@@ -17,6 +17,7 @@ import {
doublePrecision,
index,
uniqueIndex,
+ foreignKey,
type AnyPgColumn,
} from "drizzle-orm/pg-core";
import { sql } from "drizzle-orm";
@@ -151,7 +152,7 @@ export const hosts = pgTable(
ip: text("ip").notNull(),
port: integer("port").notNull(),
username: text("username").notNull(),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
// Sub-host nesting: a host acting as an organizational parent for other
// hosts, mutually exclusive with folder (see host route validation).
parentHostId: integer("parent_host_id").references(
@@ -213,12 +214,18 @@ export const hosts = pgTable(
enableDocker: boolean("enable_docker")
.notNull()
.default(false),
+ enableWebUi: boolean("enable_web_ui")
+ .notNull()
+ .default(false),
enableTmuxMonitor: boolean("enable_tmux_monitor")
.notNull()
.default(false),
enableTerminalToolbar: boolean("enable_terminal_toolbar")
.notNull()
.default(true),
+ enableAiAssistant: boolean("enable_ai_assistant")
+ .notNull()
+ .default(false),
showTerminalInSidebar: boolean("show_terminal_in_sidebar")
.notNull()
.default(true),
@@ -237,6 +244,7 @@ export const hosts = pgTable(
defaultPath: text("default_path"),
statsConfig: text("stats_config"),
dockerConfig: text("docker_config"),
+ webUiConfig: text("web_ui_config"),
enableProxmox: boolean("enable_proxmox")
.notNull()
.default(false),
@@ -440,7 +448,7 @@ export const sshCredentials = pgTable(
.references(() => users.id, { onDelete: "cascade" }),
name: varchar("name", { length: 255 }).notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
tags: text("tags"),
pin: boolean("pin").notNull().default(false),
// Manual drag-to-reorder position within a folder. Null means the
@@ -506,7 +514,7 @@ export const snippets = pgTable(
name: varchar("name", { length: 255 }).notNull(),
content: text("content").notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
order: integer("order").notNull().default(0),
syncId: varchar("sync_id", { length: 255 }).unique(),
createdAt: varchar("created_at", { length: 255 })
@@ -1023,7 +1031,7 @@ export const vaultProfiles = pgTable("vault_profiles", {
.references(() => users.id, { onDelete: "cascade" }),
name: varchar("name", { length: 255 }).notNull(),
description: text("description"),
- folder: text("folder"),
+ folder: varchar("folder", { length: 255 }),
tags: text("tags"),
// Vault server connection (non-secret)
vaultAddr: text("vault_addr").notNull(),
@@ -1137,6 +1145,7 @@ export const userPreferences = pgTable("user_preferences", {
hostTrayOnClick: boolean("host_tray_on_click"),
pinAppRail: boolean("pin_app_rail"),
expandAppRailOnHover: boolean("expand_app_rail_on_hover"),
+ showPinAppRailButton: boolean("show_pin_app_rail_button"),
foldersCollapsed: boolean("folders_collapsed"),
confirmSnippetExecution: boolean("confirm_snippet_execution"),
disableUpdateCheck: boolean("disable_update_check"),
@@ -1940,3 +1949,335 @@ export const aiProposals = pgTable(
],
);
// --- ai end ---
+
+// --- collab rooms ---
+
+/**
+ * A collaboration room: a group of users watching one "stage" - the live
+ * session the current presenter is showing. The stage points at a
+ * shareType="room" row in session_shares, so transport, gating, recording and
+ * expiry all reuse the session-sharing machinery.
+ */
+export const collabRooms = pgTable(
+ "collab_rooms",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ ownerUserId: varchar("owner_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // Persistent rooms survive being emptied and can be re-used; one-off
+ // rooms are ended explicitly and never listed again.
+ persistent: boolean("persistent")
+ .notNull()
+ .default(false),
+
+ presenterUserId: varchar("presenter_user_id", { length: 255 }).references(() => users.id, {
+ onDelete: "set null",
+ }),
+ stageProtocol: text("stage_protocol"),
+ stageHostId: integer("stage_host_id").references(() => hosts.id, {
+ onDelete: "set null",
+ }),
+ stageShareId: varchar("stage_share_id", { length: 255 }).references(() => sessionShares.id, {
+ onDelete: "set null",
+ }),
+
+ // Set = anonymous guests may watch the stage through this token.
+ guestLinkToken: varchar("guest_link_token", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ endedAt: text("ended_at"),
+ },
+ (table) => [
+ index("idx_collab_rooms_owner").on(table.ownerUserId),
+ uniqueIndex("idx_collab_rooms_guest_token").on(table.guestLinkToken),
+ ],
+);
+
+export const collabRoomMembers = pgTable(
+ "collab_room_members",
+ {
+ id: serial("id").primaryKey(),
+ roomId: varchar("room_id", { length: 255 })
+ .notNull()
+ .references(() => collabRooms.id, { onDelete: "cascade" }),
+ userId: varchar("user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // "host" runs the room: invites, force-switches the presenter, ends it.
+ roomRole: text("room_role").notNull().default("member"),
+ addedBy: varchar("added_by", { length: 255 }).references(() => users.id, {
+ onDelete: "set null",
+ }),
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ uniqueIndex("idx_collab_room_members_room_user").on(
+ table.roomId,
+ table.userId,
+ ),
+ index("idx_collab_room_members_user").on(table.userId),
+ ],
+);
+
+// --- secret sources ---
+
+/**
+ * An external password manager Termix pulls secrets from at connect time,
+ * instead of storing them. Only the access token is secret; it is encrypted
+ * with the owner's data key under the row id. Hosts and credentials refer to
+ * entries by reference ("op://vault/item/field") in their secret fields.
+ */
+export const secretSources = pgTable(
+ "secret_sources",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ userId: varchar("user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ name: varchar("name", { length: 255 }).notNull(),
+ // "onepassword-connect" for now; the reference syntax is per kind.
+ kind: text("kind").notNull().default("onepassword-connect"),
+ baseUrl: text("base_url").notNull(),
+ token: text("token").notNull(),
+ // Visible to every user; secrets still decrypt with the owner's key.
+ shared: boolean("shared").notNull().default(false),
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [index("idx_secret_sources_user").on(table.userId)],
+);
+
+// --- credential sharing ---
+
+/**
+ * Who may use or manage someone else's credential. Same shape as
+ * snippet_access; "use" attaches it to hosts and connects, "manage" also
+ * edits and re-shares it.
+ */
+export const credentialAccess = pgTable(
+ "credential_access",
+ {
+ id: serial("id").primaryKey(),
+ credentialId: integer("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ userId: varchar("user_id", { length: 255 }).references(() => users.id, { onDelete: "cascade" }),
+ roleId: integer("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ permissionLevel: text("permission_level").notNull().default("use"),
+
+ expiresAt: varchar("expires_at", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ index("idx_credential_access_user_id").on(table.userId),
+ index("idx_credential_access_role_id").on(table.roleId),
+ index("idx_credential_access_credential_id").on(table.credentialId),
+ ],
+);
+
+/**
+ * A recipient's copy of a shared credential's secrets, re-encrypted under
+ * the recipient's data key (the owner's key cannot be used by anyone else).
+ * Rebuilt whenever the owner edits the credential; one row per grant and
+ * recipient, like shared_host_secrets.
+ */
+export const sharedCredentialSecrets = pgTable(
+ "shared_credential_secrets",
+ {
+ id: serial("id").primaryKey(),
+ credentialAccessId: integer("credential_access_id").notNull(),
+ targetUserId: varchar("target_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ credentialId: integer("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ encryptedUsername: text("encrypted_username"),
+ authType: text("auth_type").notNull().default("password"),
+ encryptedPassword: text("encrypted_password"),
+ encryptedKey: text("encrypted_key"),
+ encryptedKeyPassword: text("encrypted_key_password"),
+ keyType: text("key_type"),
+ publicKey: text("public_key"),
+ certPublicKey: text("cert_public_key"),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ foreignKey({
+ columns: [table.credentialAccessId],
+ foreignColumns: [credentialAccess.id],
+ name: "shared_cred_secrets_access_id_fk",
+ }).onDelete("cascade"),
+ uniqueIndex("idx_shared_credential_secrets_scope").on(
+ table.credentialAccessId,
+ table.targetUserId,
+ ),
+ index("idx_shared_credential_secrets_target").on(
+ table.targetUserId,
+ table.credentialId,
+ ),
+ ],
+);
+
+// --- folder access rules ---
+
+/**
+ * A standing share on a host folder. Sharing a folder fans out host_access
+ * grants to the hosts in it today; this row is what makes hosts created in
+ * or moved into the folder later inherit the same access.
+ */
+export const folderAccess = pgTable(
+ "folder_access",
+ {
+ id: serial("id").primaryKey(),
+ ownerUserId: varchar("owner_user_id", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ // The folder path as stored on hosts ("Parent / Child"); subfolders inherit.
+ folder: varchar("folder", { length: 255 }).notNull(),
+
+ userId: varchar("user_id", { length: 255 }).references(() => users.id, { onDelete: "cascade" }),
+ roleId: integer("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ permissionLevel: text("permission_level").notNull().default("connect"),
+ expiresAt: varchar("expires_at", { length: 255 }),
+
+ createdAt: varchar("created_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ index("idx_folder_access_owner_folder").on(table.ownerUserId, table.folder),
+ ],
+);
+
+// --- plugins begin ---
+
+/**
+ * An installed plugin. id matches the manifest's own id (not autoincrement),
+ * so a plugin can be looked up the same way the manifest and registry refer
+ * to it. manifest_json is the full manifest as it was at install time, kept
+ * for audit/rollback even after a registry updates or removes the entry.
+ */
+export const plugins = pgTable(
+ "plugins",
+ {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ version: text("version").notNull(),
+ tier: text("tier").notNull().default("available"),
+ source: text("source").notNull().default("community"),
+ registryId: varchar("registry_id", { length: 255 }),
+ state: text("state").notNull().default("disabled"),
+ installedAt: text("installed_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ autoUpdate: boolean("auto_update")
+ .notNull()
+ .default(false),
+ manifestJson: text("manifest_json").notNull(),
+ },
+ (table) => [index("idx_plugins_registry_id").on(table.registryId)],
+);
+
+export const pluginPermissionGrants = pgTable(
+ "plugin_permission_grants",
+ {
+ id: serial("id").primaryKey(),
+ pluginId: varchar("plugin_id", { length: 255 })
+ .notNull()
+ .references(() => plugins.id, { onDelete: "cascade" }),
+ capability: varchar("capability", { length: 255 }).notNull(),
+ grantedAt: text("granted_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ grantedBy: varchar("granted_by", { length: 255 })
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ },
+ // A plugin's grants are always read together, and re-granting the same
+ // capability should update the existing row rather than duplicate it.
+ (table) => [
+ uniqueIndex("idx_plugin_permission_grants_plugin_capability").on(
+ table.pluginId,
+ table.capability,
+ ),
+ ],
+);
+
+export const pluginRegistries = pgTable("plugin_registries", {
+ id: varchar("id", { length: 255 }).primaryKey(),
+ name: varchar("name", { length: 255 }).notNull(),
+ url: text("url").notNull(),
+ kind: text("kind").notNull().default("community"),
+ enabled: boolean("enabled").notNull().default(true),
+ signingKey: text("signing_key"),
+ lastCheckedAt: text("last_checked_at"),
+ lastIndexHash: text("last_index_hash"),
+});
+
+/**
+ * Install counts populated by a background job (GitHub release download
+ * counts, aggregated telemetry, or a manual override) rather than by the
+ * install/uninstall actions themselves — kept separate from `plugins` so
+ * that job can overwrite counts without touching install state.
+ */
+export const pluginInstallCounts = pgTable(
+ "plugin_install_counts",
+ {
+ id: serial("id").primaryKey(),
+ pluginId: varchar("plugin_id", { length: 255 }).notNull(),
+ registryId: varchar("registry_id", { length: 255 }).notNull(),
+ count: integer("count").notNull().default(0),
+ source: text("source").notNull().default("aggregate-telemetry"),
+ updatedAt: varchar("updated_at", { length: 255 })
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ uniqueIndex("idx_plugin_install_counts_plugin_registry").on(
+ table.pluginId,
+ table.registryId,
+ ),
+ ],
+);
+
+// --- plugins end ---
diff --git a/src/backend/database/db/schema.ts b/src/backend/database/db/schema.ts
index 6a15e349f..3d90de3d3 100644
--- a/src/backend/database/db/schema.ts
+++ b/src/backend/database/db/schema.ts
@@ -5,6 +5,7 @@ import {
real,
index,
uniqueIndex,
+ foreignKey,
type AnySQLiteColumn,
} from "drizzle-orm/sqlite-core";
import { sql } from "drizzle-orm";
@@ -205,12 +206,18 @@ export const hosts = sqliteTable(
enableDocker: integer("enable_docker", { mode: "boolean" })
.notNull()
.default(false),
+ enableWebUi: integer("enable_web_ui", { mode: "boolean" })
+ .notNull()
+ .default(false),
enableTmuxMonitor: integer("enable_tmux_monitor", { mode: "boolean" })
.notNull()
.default(false),
enableTerminalToolbar: integer("enable_terminal_toolbar", { mode: "boolean" })
.notNull()
.default(true),
+ enableAiAssistant: integer("enable_ai_assistant", { mode: "boolean" })
+ .notNull()
+ .default(false),
showTerminalInSidebar: integer("show_terminal_in_sidebar", { mode: "boolean" })
.notNull()
.default(true),
@@ -229,6 +236,7 @@ export const hosts = sqliteTable(
defaultPath: text("default_path"),
statsConfig: text("stats_config"),
dockerConfig: text("docker_config"),
+ webUiConfig: text("web_ui_config"),
enableProxmox: integer("enable_proxmox", { mode: "boolean" })
.notNull()
.default(false),
@@ -1133,6 +1141,9 @@ export const userPreferences = sqliteTable("user_preferences", {
expandAppRailOnHover: integer("expand_app_rail_on_hover", {
mode: "boolean",
}),
+ showPinAppRailButton: integer("show_pin_app_rail_button", {
+ mode: "boolean",
+ }),
foldersCollapsed: integer("folders_collapsed", { mode: "boolean" }),
confirmSnippetExecution: integer("confirm_snippet_execution", { mode: "boolean" }),
disableUpdateCheck: integer("disable_update_check", { mode: "boolean" }),
@@ -1936,3 +1947,335 @@ export const aiProposals = sqliteTable(
],
);
// --- ai end ---
+
+// --- collab rooms ---
+
+/**
+ * A collaboration room: a group of users watching one "stage" - the live
+ * session the current presenter is showing. The stage points at a
+ * shareType="room" row in session_shares, so transport, gating, recording and
+ * expiry all reuse the session-sharing machinery.
+ */
+export const collabRooms = sqliteTable(
+ "collab_rooms",
+ {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ ownerUserId: text("owner_user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // Persistent rooms survive being emptied and can be re-used; one-off
+ // rooms are ended explicitly and never listed again.
+ persistent: integer("persistent", { mode: "boolean" })
+ .notNull()
+ .default(false),
+
+ presenterUserId: text("presenter_user_id").references(() => users.id, {
+ onDelete: "set null",
+ }),
+ stageProtocol: text("stage_protocol"),
+ stageHostId: integer("stage_host_id").references(() => hosts.id, {
+ onDelete: "set null",
+ }),
+ stageShareId: text("stage_share_id").references(() => sessionShares.id, {
+ onDelete: "set null",
+ }),
+
+ // Set = anonymous guests may watch the stage through this token.
+ guestLinkToken: text("guest_link_token"),
+
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ endedAt: text("ended_at"),
+ },
+ (table) => [
+ index("idx_collab_rooms_owner").on(table.ownerUserId),
+ uniqueIndex("idx_collab_rooms_guest_token").on(table.guestLinkToken),
+ ],
+);
+
+export const collabRoomMembers = sqliteTable(
+ "collab_room_members",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ roomId: text("room_id")
+ .notNull()
+ .references(() => collabRooms.id, { onDelete: "cascade" }),
+ userId: text("user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ // "host" runs the room: invites, force-switches the presenter, ends it.
+ roomRole: text("room_role").notNull().default("member"),
+ addedBy: text("added_by").references(() => users.id, {
+ onDelete: "set null",
+ }),
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ uniqueIndex("idx_collab_room_members_room_user").on(
+ table.roomId,
+ table.userId,
+ ),
+ index("idx_collab_room_members_user").on(table.userId),
+ ],
+);
+
+// --- secret sources ---
+
+/**
+ * An external password manager Termix pulls secrets from at connect time,
+ * instead of storing them. Only the access token is secret; it is encrypted
+ * with the owner's data key under the row id. Hosts and credentials refer to
+ * entries by reference ("op://vault/item/field") in their secret fields.
+ */
+export const secretSources = sqliteTable(
+ "secret_sources",
+ {
+ id: text("id").primaryKey(),
+ userId: text("user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ name: text("name").notNull(),
+ // "onepassword-connect" for now; the reference syntax is per kind.
+ kind: text("kind").notNull().default("onepassword-connect"),
+ baseUrl: text("base_url").notNull(),
+ token: text("token").notNull(),
+ // Visible to every user; secrets still decrypt with the owner's key.
+ shared: integer("shared", { mode: "boolean" }).notNull().default(false),
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: text("updated_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [index("idx_secret_sources_user").on(table.userId)],
+);
+
+// --- credential sharing ---
+
+/**
+ * Who may use or manage someone else's credential. Same shape as
+ * snippet_access; "use" attaches it to hosts and connects, "manage" also
+ * edits and re-shares it.
+ */
+export const credentialAccess = sqliteTable(
+ "credential_access",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ credentialId: integer("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ userId: text("user_id").references(() => users.id, { onDelete: "cascade" }),
+ roleId: integer("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: text("granted_by")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+
+ permissionLevel: text("permission_level").notNull().default("use"),
+
+ expiresAt: text("expires_at"),
+
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ index("idx_credential_access_user_id").on(table.userId),
+ index("idx_credential_access_role_id").on(table.roleId),
+ index("idx_credential_access_credential_id").on(table.credentialId),
+ ],
+);
+
+/**
+ * A recipient's copy of a shared credential's secrets, re-encrypted under
+ * the recipient's data key (the owner's key cannot be used by anyone else).
+ * Rebuilt whenever the owner edits the credential; one row per grant and
+ * recipient, like shared_host_secrets.
+ */
+export const sharedCredentialSecrets = sqliteTable(
+ "shared_credential_secrets",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ credentialAccessId: integer("credential_access_id").notNull(),
+ targetUserId: text("target_user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ credentialId: integer("credential_id")
+ .notNull()
+ .references(() => sshCredentials.id, { onDelete: "cascade" }),
+
+ encryptedUsername: text("encrypted_username"),
+ authType: text("auth_type").notNull().default("password"),
+ encryptedPassword: text("encrypted_password"),
+ encryptedKey: text("encrypted_key", { length: 16384 }),
+ encryptedKeyPassword: text("encrypted_key_password"),
+ keyType: text("key_type"),
+ publicKey: text("public_key", { length: 4096 }),
+ certPublicKey: text("cert_public_key", { length: 8192 }),
+
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: text("updated_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ foreignKey({
+ columns: [table.credentialAccessId],
+ foreignColumns: [credentialAccess.id],
+ name: "shared_cred_secrets_access_id_fk",
+ }).onDelete("cascade"),
+ uniqueIndex("idx_shared_credential_secrets_scope").on(
+ table.credentialAccessId,
+ table.targetUserId,
+ ),
+ index("idx_shared_credential_secrets_target").on(
+ table.targetUserId,
+ table.credentialId,
+ ),
+ ],
+);
+
+// --- folder access rules ---
+
+/**
+ * A standing share on a host folder. Sharing a folder fans out host_access
+ * grants to the hosts in it today; this row is what makes hosts created in
+ * or moved into the folder later inherit the same access.
+ */
+export const folderAccess = sqliteTable(
+ "folder_access",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ ownerUserId: text("owner_user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ // The folder path as stored on hosts ("Parent / Child"); subfolders inherit.
+ folder: text("folder").notNull(),
+
+ userId: text("user_id").references(() => users.id, { onDelete: "cascade" }),
+ roleId: integer("role_id").references(() => roles.id, {
+ onDelete: "cascade",
+ }),
+
+ grantedBy: text("granted_by")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ permissionLevel: text("permission_level").notNull().default("connect"),
+ expiresAt: text("expires_at"),
+
+ createdAt: text("created_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ index("idx_folder_access_owner_folder").on(table.ownerUserId, table.folder),
+ ],
+);
+
+// --- plugins begin ---
+
+/**
+ * An installed plugin. id matches the manifest's own id (not autoincrement),
+ * so a plugin can be looked up the same way the manifest and registry refer
+ * to it. manifest_json is the full manifest as it was at install time, kept
+ * for audit/rollback even after a registry updates or removes the entry.
+ */
+export const plugins = sqliteTable(
+ "plugins",
+ {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ version: text("version").notNull(),
+ tier: text("tier").notNull().default("available"),
+ source: text("source").notNull().default("community"),
+ registryId: text("registry_id"),
+ state: text("state").notNull().default("disabled"),
+ installedAt: text("installed_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ updatedAt: text("updated_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ autoUpdate: integer("auto_update", { mode: "boolean" })
+ .notNull()
+ .default(false),
+ manifestJson: text("manifest_json").notNull(),
+ },
+ (table) => [index("idx_plugins_registry_id").on(table.registryId)],
+);
+
+export const pluginPermissionGrants = sqliteTable(
+ "plugin_permission_grants",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ pluginId: text("plugin_id")
+ .notNull()
+ .references(() => plugins.id, { onDelete: "cascade" }),
+ capability: text("capability").notNull(),
+ grantedAt: text("granted_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ grantedBy: text("granted_by")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ },
+ // A plugin's grants are always read together, and re-granting the same
+ // capability should update the existing row rather than duplicate it.
+ (table) => [
+ uniqueIndex("idx_plugin_permission_grants_plugin_capability").on(
+ table.pluginId,
+ table.capability,
+ ),
+ ],
+);
+
+export const pluginRegistries = sqliteTable("plugin_registries", {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ url: text("url").notNull(),
+ kind: text("kind").notNull().default("community"),
+ enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
+ signingKey: text("signing_key"),
+ lastCheckedAt: text("last_checked_at"),
+ lastIndexHash: text("last_index_hash"),
+});
+
+/**
+ * Install counts populated by a background job (GitHub release download
+ * counts, aggregated telemetry, or a manual override) rather than by the
+ * install/uninstall actions themselves — kept separate from `plugins` so
+ * that job can overwrite counts without touching install state.
+ */
+export const pluginInstallCounts = sqliteTable(
+ "plugin_install_counts",
+ {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ pluginId: text("plugin_id").notNull(),
+ registryId: text("registry_id").notNull(),
+ count: integer("count").notNull().default(0),
+ source: text("source").notNull().default("aggregate-telemetry"),
+ updatedAt: text("updated_at")
+ .notNull()
+ .default(sql`CURRENT_TIMESTAMP`),
+ },
+ (table) => [
+ uniqueIndex("idx_plugin_install_counts_plugin_registry").on(
+ table.pluginId,
+ table.registryId,
+ ),
+ ],
+);
+
+// --- plugins end ---
diff --git a/src/backend/database/repositories/collab-room-repository.ts b/src/backend/database/repositories/collab-room-repository.ts
new file mode 100644
index 000000000..0d212fe31
--- /dev/null
+++ b/src/backend/database/repositories/collab-room-repository.ts
@@ -0,0 +1,222 @@
+import { and, desc, eq, isNull } from "drizzle-orm";
+import { collabRoomMembers, collabRooms, users } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { insertReturning } from "./returning.js";
+import { rowsAffected } from "./mutation-result.js";
+
+export type CollabRoomRecord = typeof collabRooms.$inferSelect;
+export type CollabRoomMemberRecord = typeof collabRoomMembers.$inferSelect;
+
+export type CollabRoomRole = "host" | "member";
+
+export interface CollabRoomMemberWithUser {
+ userId: string;
+ username: string;
+ roomRole: string;
+ createdAt: string;
+}
+
+export interface CollabRoomStage {
+ presenterUserId: string | null;
+ stageProtocol: string | null;
+ stageHostId: number | null;
+ stageShareId: string | null;
+}
+
+export class CollabRoomRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async createRoom(input: {
+ id: string;
+ name: string;
+ ownerUserId: string;
+ persistent: boolean;
+ }): Promise {
+ const [created] = await insertReturning(this.context, collabRooms, {
+ id: input.id,
+ name: input.name,
+ ownerUserId: input.ownerUserId,
+ persistent: input.persistent,
+ });
+ await this.afterWrite();
+ return created;
+ }
+
+ async findById(id: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(collabRooms)
+ .where(eq(collabRooms.id, id))
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ /** The live room whose stage points at this share, if any. */
+ async findByStageShareId(shareId: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(collabRooms)
+ .where(
+ and(eq(collabRooms.stageShareId, shareId), isNull(collabRooms.endedAt)),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async findByGuestToken(token: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(collabRooms)
+ .where(
+ and(eq(collabRooms.guestLinkToken, token), isNull(collabRooms.endedAt)),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async setGuestToken(roomId: string, token: string | null): Promise {
+ await this.context.drizzle
+ .update(collabRooms)
+ .set({ guestLinkToken: token })
+ .where(eq(collabRooms.id, roomId));
+ await this.afterWrite();
+ }
+
+ async listForUser(userId: string): Promise {
+ const rows = await this.context.drizzle
+ .select({ room: collabRooms })
+ .from(collabRoomMembers)
+ .innerJoin(collabRooms, eq(collabRoomMembers.roomId, collabRooms.id))
+ .where(
+ and(eq(collabRoomMembers.userId, userId), isNull(collabRooms.endedAt)),
+ )
+ .orderBy(desc(collabRooms.createdAt));
+ return rows.map((row) => row.room);
+ }
+
+ async findMember(
+ roomId: string,
+ userId: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(collabRoomMembers)
+ .where(
+ and(
+ eq(collabRoomMembers.roomId, roomId),
+ eq(collabRoomMembers.userId, userId),
+ ),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async addMember(input: {
+ roomId: string;
+ userId: string;
+ roomRole: CollabRoomRole;
+ addedBy: string | null;
+ }): Promise {
+ if (await this.findMember(input.roomId, input.userId)) return false;
+ await this.context.drizzle.insert(collabRoomMembers).values({
+ roomId: input.roomId,
+ userId: input.userId,
+ roomRole: input.roomRole,
+ addedBy: input.addedBy,
+ });
+ await this.afterWrite();
+ return true;
+ }
+
+ async removeMember(roomId: string, userId: string): Promise {
+ await this.context.drizzle
+ .delete(collabRoomMembers)
+ .where(
+ and(
+ eq(collabRoomMembers.roomId, roomId),
+ eq(collabRoomMembers.userId, userId),
+ ),
+ );
+ await this.afterWrite();
+ }
+
+ async listMembers(roomId: string): Promise {
+ return this.context.drizzle
+ .select({
+ userId: collabRoomMembers.userId,
+ username: users.username,
+ roomRole: collabRoomMembers.roomRole,
+ createdAt: collabRoomMembers.createdAt,
+ })
+ .from(collabRoomMembers)
+ .innerJoin(users, eq(collabRoomMembers.userId, users.id))
+ .where(eq(collabRoomMembers.roomId, roomId))
+ .orderBy(users.username);
+ }
+
+ async updateStage(roomId: string, stage: CollabRoomStage): Promise {
+ await this.context.drizzle
+ .update(collabRooms)
+ .set(stage)
+ .where(eq(collabRooms.id, roomId));
+ await this.afterWrite();
+ }
+
+ async replaceStage(
+ roomId: string,
+ expectedShareId: string | null,
+ stage: CollabRoomStage,
+ ): Promise {
+ const result = await this.context.drizzle
+ .update(collabRooms)
+ .set(stage)
+ .where(
+ and(
+ eq(collabRooms.id, roomId),
+ expectedShareId
+ ? eq(collabRooms.stageShareId, expectedShareId)
+ : isNull(collabRooms.stageShareId),
+ ),
+ );
+ const changed = rowsAffected(result) > 0;
+ if (changed) await this.afterWrite();
+ return changed;
+ }
+
+ async clearStage(roomId: string): Promise {
+ return this.updateStage(roomId, {
+ presenterUserId: null,
+ stageProtocol: null,
+ stageHostId: null,
+ stageShareId: null,
+ });
+ }
+
+ async endRoom(roomId: string): Promise {
+ await this.context.drizzle
+ .update(collabRooms)
+ .set({
+ endedAt: new Date().toISOString(),
+ presenterUserId: null,
+ stageProtocol: null,
+ stageHostId: null,
+ stageShareId: null,
+ })
+ .where(eq(collabRooms.id, roomId));
+ await this.afterWrite();
+ }
+
+ async deleteRoom(roomId: string): Promise {
+ await this.context.drizzle
+ .delete(collabRooms)
+ .where(eq(collabRooms.id, roomId));
+ await this.afterWrite();
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/credential-access-repository.ts b/src/backend/database/repositories/credential-access-repository.ts
new file mode 100644
index 000000000..9f921f41b
--- /dev/null
+++ b/src/backend/database/repositories/credential-access-repository.ts
@@ -0,0 +1,276 @@
+import { and, eq, gte, inArray, isNull, or, type SQL } from "drizzle-orm";
+import { alias } from "drizzle-orm/sqlite-core";
+import {
+ credentialAccess,
+ roles,
+ sshCredentials,
+ users,
+} from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { insertReturning } from "./returning.js";
+
+export type CredentialAccessRecord = typeof credentialAccess.$inferSelect;
+export type CredentialPermissionLevel = "use" | "manage";
+
+export interface CredentialAccessListItem extends CredentialAccessRecord {
+ targetType: "user" | "role";
+ username: string | null;
+ roleName: string | null;
+ roleDisplayName: string | null;
+ grantedByUsername: string | null;
+}
+
+export type CredentialAccessTarget =
+ | { targetType: "user"; targetUserId: string }
+ | { targetType: "role"; targetRoleId: number };
+
+export interface UpsertCredentialAccessInput {
+ credentialId: number;
+ grantedBy: string;
+ permissionLevel: CredentialPermissionLevel;
+ expiresAt: string | null;
+ target: CredentialAccessTarget;
+}
+
+/** A credential shared with the caller, with the grant that admits them. */
+export interface SharedCredentialGrant {
+ accessId: number;
+ credentialId: number;
+ ownerId: string;
+ permissionLevel: string;
+ expiresAt: string | null;
+}
+
+function activeFilter(now: string): SQL {
+ return or(
+ isNull(credentialAccess.expiresAt),
+ gte(credentialAccess.expiresAt, now),
+ )!;
+}
+
+function granteeFilter(userId: string, roleIds: number[]): SQL {
+ return roleIds.length === 0
+ ? eq(credentialAccess.userId, userId)
+ : or(
+ eq(credentialAccess.userId, userId),
+ inArray(credentialAccess.roleId, roleIds),
+ )!;
+}
+
+export class CredentialAccessRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async listForCredential(
+ credentialId: number,
+ ): Promise {
+ const granter = alias(users, "granter");
+ const rows = await this.context.drizzle
+ .select({
+ access: credentialAccess,
+ username: users.username,
+ roleName: roles.name,
+ roleDisplayName: roles.displayName,
+ grantedByUsername: granter.username,
+ })
+ .from(credentialAccess)
+ .leftJoin(users, eq(credentialAccess.userId, users.id))
+ .leftJoin(roles, eq(credentialAccess.roleId, roles.id))
+ .leftJoin(granter, eq(credentialAccess.grantedBy, granter.id))
+ .where(eq(credentialAccess.credentialId, credentialId));
+ return rows.map((row) => ({
+ ...row.access,
+ targetType: row.access.roleId ? ("role" as const) : ("user" as const),
+ username: row.username,
+ roleName: row.roleName,
+ roleDisplayName: row.roleDisplayName,
+ grantedByUsername: row.grantedByUsername,
+ }));
+ }
+
+ async upsert(
+ input: UpsertCredentialAccessInput,
+ ): Promise<{ id: number; created: boolean }> {
+ const targetFilter =
+ input.target.targetType === "user"
+ ? eq(credentialAccess.userId, input.target.targetUserId)
+ : eq(credentialAccess.roleId, input.target.targetRoleId);
+ const existing = await this.context.drizzle
+ .select({ id: credentialAccess.id })
+ .from(credentialAccess)
+ .where(
+ and(
+ eq(credentialAccess.credentialId, input.credentialId),
+ targetFilter,
+ ),
+ )
+ .limit(1);
+
+ if (existing[0]) {
+ await this.context.drizzle
+ .update(credentialAccess)
+ .set({
+ permissionLevel: input.permissionLevel,
+ expiresAt: input.expiresAt,
+ grantedBy: input.grantedBy,
+ })
+ .where(eq(credentialAccess.id, existing[0].id));
+ await this.afterWrite();
+ return { id: existing[0].id, created: false };
+ }
+
+ const [created] = await insertReturning(this.context, credentialAccess, {
+ credentialId: input.credentialId,
+ userId:
+ input.target.targetType === "user" ? input.target.targetUserId : null,
+ roleId:
+ input.target.targetType === "role" ? input.target.targetRoleId : null,
+ grantedBy: input.grantedBy,
+ permissionLevel: input.permissionLevel,
+ expiresAt: input.expiresAt,
+ });
+ await this.afterWrite();
+ return { id: created.id, created: true };
+ }
+
+ async findById(
+ accessId: number,
+ credentialId: number,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(credentialAccess)
+ .where(
+ and(
+ eq(credentialAccess.id, accessId),
+ eq(credentialAccess.credentialId, credentialId),
+ ),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async revoke(accessId: number, credentialId: number): Promise {
+ await this.context.drizzle
+ .delete(credentialAccess)
+ .where(
+ and(
+ eq(credentialAccess.id, accessId),
+ eq(credentialAccess.credentialId, credentialId),
+ ),
+ );
+ await this.afterWrite();
+ }
+
+ /** The strongest unexpired grant admitting this user to the credential. */
+ async findActiveGrant(
+ credentialId: number,
+ userId: string,
+ roleIds: number[],
+ now = new Date().toISOString(),
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(credentialAccess)
+ .where(
+ and(
+ eq(credentialAccess.credentialId, credentialId),
+ granteeFilter(userId, roleIds),
+ activeFilter(now),
+ ),
+ );
+ return (
+ rows.find((row) => row.permissionLevel === "manage") ?? rows[0] ?? null
+ );
+ }
+
+ /** Every credential shared with this user (directly or via a role). */
+ async listSharedWithUser(
+ userId: string,
+ roleIds: number[],
+ now = new Date().toISOString(),
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select({
+ accessId: credentialAccess.id,
+ credentialId: credentialAccess.credentialId,
+ ownerId: sshCredentials.userId,
+ permissionLevel: credentialAccess.permissionLevel,
+ expiresAt: credentialAccess.expiresAt,
+ })
+ .from(credentialAccess)
+ .innerJoin(
+ sshCredentials,
+ eq(credentialAccess.credentialId, sshCredentials.id),
+ )
+ .where(and(granteeFilter(userId, roleIds), activeFilter(now)));
+ // Direct and role grants can overlap; keep the strongest per credential.
+ const best = new Map();
+ for (const row of rows) {
+ if (row.ownerId === userId) continue;
+ const current = best.get(row.credentialId);
+ if (!current || row.permissionLevel === "manage")
+ best.set(row.credentialId, row);
+ }
+ return Array.from(best.values());
+ }
+
+ /** Active grants on one credential, expanded to user and role targets. */
+ async listActiveGrants(
+ credentialId: number,
+ now = new Date().toISOString(),
+ ): Promise {
+ return this.context.drizzle
+ .select()
+ .from(credentialAccess)
+ .where(
+ and(eq(credentialAccess.credentialId, credentialId), activeFilter(now)),
+ );
+ }
+
+ /** Grants a role holds, with the credential owner - for new-member snapshots. */
+ async listRoleGrants(
+ roleId: number,
+ ): Promise<
+ Array<{ accessId: number; credentialId: number; ownerId: string }>
+ > {
+ return this.context.drizzle
+ .select({
+ accessId: credentialAccess.id,
+ credentialId: credentialAccess.credentialId,
+ ownerId: sshCredentials.userId,
+ })
+ .from(credentialAccess)
+ .innerJoin(
+ sshCredentials,
+ eq(credentialAccess.credentialId, sshCredentials.id),
+ )
+ .where(eq(credentialAccess.roleId, roleId));
+ }
+
+ async deleteForUserReferences(userId: string): Promise {
+ await this.context.drizzle
+ .delete(credentialAccess)
+ .where(
+ or(
+ eq(credentialAccess.userId, userId),
+ eq(credentialAccess.grantedBy, userId),
+ ),
+ );
+ await this.afterWrite();
+ }
+
+ async reassignGrantedBy(fromUserId: string, toUserId: string): Promise {
+ await this.context.drizzle
+ .update(credentialAccess)
+ .set({ grantedBy: toUserId })
+ .where(eq(credentialAccess.grantedBy, fromUserId));
+ await this.afterWrite();
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/credential-repository.ts b/src/backend/database/repositories/credential-repository.ts
index b6d3c2e38..db3fbd610 100644
--- a/src/backend/database/repositories/credential-repository.ts
+++ b/src/backend/database/repositories/credential-repository.ts
@@ -348,6 +348,54 @@ export class CredentialRepository {
);
}
+ /**
+ * Re-keys every credential of one user to another: decrypt under the old
+ * owner's key, encrypt under the new one, change the owner. Used when an
+ * account is deleted and its data is inherited rather than dropped.
+ */
+ async transferAllToUser(
+ fromUserId: string,
+ toUserId: string,
+ ): Promise {
+ const fromKey = DataCrypto.validateUserAccess(fromUserId);
+ const toKey = DataCrypto.validateUserAccess(toUserId);
+ const rows = await this.context.drizzle
+ .select()
+ .from(sshCredentials)
+ .where(eq(sshCredentials.userId, fromUserId));
+ const moved: number[] = [];
+ for (const row of rows) {
+ const plain = DataCrypto.decryptRecord(
+ "ssh_credentials",
+ row,
+ fromUserId,
+ fromKey,
+ );
+ const {
+ id: _id,
+ userId: _userId,
+ ...fields
+ } = plain as Record;
+ const encrypted = DataCrypto.encryptRecord(
+ "ssh_credentials",
+ { ...fields, id: row.id },
+ toUserId,
+ toKey,
+ ) as Record;
+ delete encrypted.id;
+ await this.context.drizzle
+ .update(sshCredentials)
+ .set({
+ ...(encrypted as Partial),
+ userId: toUserId,
+ })
+ .where(eq(sshCredentials.id, row.id));
+ moved.push(row.id);
+ }
+ if (moved.length) await this.afterWrite();
+ return moved;
+ }
+
private encryptCredentialRecordForWrite>(
record: T,
userId: string,
diff --git a/src/backend/database/repositories/factory.ts b/src/backend/database/repositories/factory.ts
index 5cd2679f1..9e060f70b 100644
--- a/src/backend/database/repositories/factory.ts
+++ b/src/backend/database/repositories/factory.ts
@@ -32,12 +32,21 @@ import { UiPreferenceRepository } from "./ui-preference-repository.js";
import { NetworkTopologyRepository } from "./network-topology-repository.js";
import { OpenTabRepository } from "./open-tab-repository.js";
import { OpksshTokenRepository } from "./opkssh-token-repository.js";
+import { PluginRepository } from "./plugin-repository.js";
+import { PluginPermissionGrantRepository } from "./plugin-permission-grant-repository.js";
+import { PluginRegistryRepository } from "./plugin-registry-repository.js";
+import { PluginInstallCountRepository } from "./plugin-install-count-repository.js";
import { RbacAccessRepository } from "./rbac-access-repository.js";
import { RecentActivityRepository } from "./recent-activity-repository.js";
import { RoleRepository } from "./role-repository.js";
import { SessionRecordingRepository } from "./session-recording-repository.js";
import { SessionRepository } from "./session-repository.js";
import { SessionShareRepository } from "./session-share-repository.js";
+import { CollabRoomRepository } from "./collab-room-repository.js";
+import { SecretSourceRepository } from "./secret-source-repository.js";
+import { CredentialAccessRepository } from "./credential-access-repository.js";
+import { SharedCredentialSecretsRepository } from "./shared-credential-secrets-repository.js";
+import { FolderAccessRepository } from "./folder-access-repository.js";
import { SettingsRepository } from "./settings-repository.js";
import { SharedHostAuthOverrideRepository } from "./shared-host-auth-override-repository.js";
import { SharedHostSecretsRepository } from "./shared-host-secrets-repository.js";
@@ -360,6 +369,38 @@ export function createCurrentOpksshTokenRepository(): OpksshTokenRepository {
);
}
+export function createCurrentPluginRepository(): PluginRepository {
+ return new PluginRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("plugin_repository_write"),
+ );
+}
+
+export function createCurrentPluginPermissionGrantRepository(): PluginPermissionGrantRepository {
+ return new PluginPermissionGrantRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook(
+ "plugin_permission_grant_repository_write",
+ ),
+ );
+}
+
+export function createCurrentPluginRegistryRepository(): PluginRegistryRepository {
+ return new PluginRegistryRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("plugin_registry_repository_write"),
+ );
+}
+
+export function createCurrentPluginInstallCountRepository(): PluginInstallCountRepository {
+ return new PluginInstallCountRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryLazyWriteHook(
+ "plugin_install_count_repository_write",
+ ),
+ );
+}
+
export function createCurrentRbacAccessRepository(): RbacAccessRepository {
return new RbacAccessRepository(
createCurrentRepositoryContext(),
@@ -395,6 +436,13 @@ export function createCurrentSessionRepository(): SessionRepository {
);
}
+export function createCurrentCollabRoomRepository(): CollabRoomRepository {
+ return new CollabRoomRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("collab_room_repository_write"),
+ );
+}
+
export function createCurrentSessionShareRepository(): SessionShareRepository {
return new SessionShareRepository(
createCurrentRepositoryContext(),
@@ -499,6 +547,36 @@ export function createCurrentUserRepository(): UserRepository {
);
}
+export function createCurrentFolderAccessRepository(): FolderAccessRepository {
+ return new FolderAccessRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("folder_access_repository_write"),
+ );
+}
+
+export function createCurrentCredentialAccessRepository(): CredentialAccessRepository {
+ return new CredentialAccessRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("credential_access_repository_write"),
+ );
+}
+
+export function createCurrentSharedCredentialSecretsRepository(): SharedCredentialSecretsRepository {
+ return new SharedCredentialSecretsRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook(
+ "shared_credential_secrets_repository_write",
+ ),
+ );
+}
+
+export function createCurrentSecretSourceRepository(): SecretSourceRepository {
+ return new SecretSourceRepository(
+ createCurrentRepositoryContext(),
+ createCurrentRepositoryWriteHook("secret_source_repository_write"),
+ );
+}
+
export function createCurrentVaultProfileRepository(): VaultProfileRepository {
return new VaultProfileRepository(
createCurrentRepositoryContext(),
diff --git a/src/backend/database/repositories/folder-access-repository.ts b/src/backend/database/repositories/folder-access-repository.ts
new file mode 100644
index 000000000..5875d3acd
--- /dev/null
+++ b/src/backend/database/repositories/folder-access-repository.ts
@@ -0,0 +1,190 @@
+import { and, eq, inArray, like, or } from "drizzle-orm";
+import { folderAccess, roles, users } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { insertReturning } from "./returning.js";
+
+export type FolderAccessRecord = typeof folderAccess.$inferSelect;
+
+export interface FolderAccessListItem extends FolderAccessRecord {
+ targetType: "user" | "role";
+ username: string | null;
+ roleName: string | null;
+ roleDisplayName: string | null;
+}
+
+export type FolderAccessTarget =
+ | { targetType: "user"; targetUserId: string }
+ | { targetType: "role"; targetRoleId: number };
+
+/** "A / B / C" → ["A", "A / B", "A / B / C"]: a host inherits rules on every ancestor. */
+export function folderAncestors(folder: string): string[] {
+ const parts = folder.split(" / ");
+ return parts.map((_, i) => parts.slice(0, i + 1).join(" / "));
+}
+
+export class FolderAccessRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async upsert(input: {
+ ownerUserId: string;
+ folder: string;
+ grantedBy: string;
+ permissionLevel: string;
+ expiresAt: string | null;
+ target: FolderAccessTarget;
+ }): Promise {
+ const targetFilter =
+ input.target.targetType === "user"
+ ? eq(folderAccess.userId, input.target.targetUserId)
+ : eq(folderAccess.roleId, input.target.targetRoleId);
+ const existing = await this.context.drizzle
+ .select()
+ .from(folderAccess)
+ .where(
+ and(
+ eq(folderAccess.ownerUserId, input.ownerUserId),
+ eq(folderAccess.folder, input.folder),
+ targetFilter,
+ ),
+ )
+ .limit(1);
+ if (existing[0]) {
+ await this.context.drizzle
+ .update(folderAccess)
+ .set({
+ permissionLevel: input.permissionLevel,
+ expiresAt: input.expiresAt,
+ grantedBy: input.grantedBy,
+ })
+ .where(eq(folderAccess.id, existing[0].id));
+ await this.afterWrite();
+ return {
+ ...existing[0],
+ permissionLevel: input.permissionLevel,
+ expiresAt: input.expiresAt,
+ };
+ }
+ const [created] = await insertReturning(this.context, folderAccess, {
+ ownerUserId: input.ownerUserId,
+ folder: input.folder,
+ userId:
+ input.target.targetType === "user" ? input.target.targetUserId : null,
+ roleId:
+ input.target.targetType === "role" ? input.target.targetRoleId : null,
+ grantedBy: input.grantedBy,
+ permissionLevel: input.permissionLevel,
+ expiresAt: input.expiresAt,
+ });
+ await this.afterWrite();
+ return created;
+ }
+
+ /** Rules that apply to a host in this folder: the folder's own and its ancestors'. */
+ async listApplicable(
+ ownerUserId: string,
+ folder: string,
+ now = new Date().toISOString(),
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(folderAccess)
+ .where(
+ and(
+ eq(folderAccess.ownerUserId, ownerUserId),
+ inArray(folderAccess.folder, folderAncestors(folder)),
+ ),
+ );
+ return rows.filter((row) => !row.expiresAt || row.expiresAt >= now);
+ }
+
+ async listForFolder(
+ ownerUserId: string,
+ folder: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select({
+ rule: folderAccess,
+ username: users.username,
+ roleName: roles.name,
+ roleDisplayName: roles.displayName,
+ })
+ .from(folderAccess)
+ .leftJoin(users, eq(folderAccess.userId, users.id))
+ .leftJoin(roles, eq(folderAccess.roleId, roles.id))
+ .where(
+ and(
+ eq(folderAccess.ownerUserId, ownerUserId),
+ eq(folderAccess.folder, folder),
+ ),
+ );
+ return rows.map((row) => ({
+ ...row.rule,
+ targetType: row.rule.roleId ? ("role" as const) : ("user" as const),
+ username: row.username,
+ roleName: row.roleName,
+ roleDisplayName: row.roleDisplayName,
+ }));
+ }
+
+ async findById(
+ id: number,
+ ownerUserId: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(folderAccess)
+ .where(
+ and(eq(folderAccess.id, id), eq(folderAccess.ownerUserId, ownerUserId)),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async deleteById(id: number, ownerUserId: string): Promise {
+ await this.context.drizzle
+ .delete(folderAccess)
+ .where(
+ and(eq(folderAccess.id, id), eq(folderAccess.ownerUserId, ownerUserId)),
+ );
+ await this.afterWrite();
+ }
+
+ /** Follows a folder rename, including subfolders. */
+ async renameFolder(
+ ownerUserId: string,
+ oldName: string,
+ newName: string,
+ ): Promise {
+ const prefix = `${oldName} / `;
+ const rows = await this.context.drizzle
+ .select({ id: folderAccess.id, folder: folderAccess.folder })
+ .from(folderAccess)
+ .where(
+ and(
+ eq(folderAccess.ownerUserId, ownerUserId),
+ or(
+ eq(folderAccess.folder, oldName),
+ like(folderAccess.folder, `${prefix}%`),
+ ),
+ ),
+ );
+ for (const row of rows) {
+ const renamed =
+ row.folder === oldName
+ ? newName
+ : `${newName} / ${row.folder.slice(prefix.length)}`;
+ await this.context.drizzle
+ .update(folderAccess)
+ .set({ folder: renamed })
+ .where(eq(folderAccess.id, row.id));
+ }
+ if (rows.length) await this.afterWrite();
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/host-repository.ts b/src/backend/database/repositories/host-repository.ts
index 6327c9baf..3a4ab9735 100644
--- a/src/backend/database/repositories/host-repository.ts
+++ b/src/backend/database/repositories/host-repository.ts
@@ -168,6 +168,47 @@ export class HostRepository {
return rows[0] ?? null;
}
+ /** Re-keys every host of one user to another; see CredentialRepository.transferAllToUser. */
+ async transferAllToUser(
+ fromUserId: string,
+ toUserId: string,
+ ): Promise {
+ const fromKey = DataCrypto.validateUserAccess(fromUserId);
+ const toKey = DataCrypto.validateUserAccess(toUserId);
+ const rows = await this.context.drizzle
+ .select()
+ .from(hosts)
+ .where(eq(hosts.userId, fromUserId));
+ const moved: number[] = [];
+ for (const row of rows) {
+ const plain = DataCrypto.decryptRecord(
+ "ssh_data",
+ row,
+ fromUserId,
+ fromKey,
+ );
+ const {
+ id: _id,
+ userId: _userId,
+ ...fields
+ } = plain as Record;
+ const encrypted = DataCrypto.encryptRecord(
+ "ssh_data",
+ { ...fields, id: row.id },
+ toUserId,
+ toKey,
+ ) as Record;
+ delete encrypted.id;
+ await this.context.drizzle
+ .update(hosts)
+ .set({ ...(encrypted as Partial), userId: toUserId })
+ .where(eq(hosts.id, row.id));
+ moved.push(row.id);
+ }
+ if (moved.length) await this.afterWrite();
+ return moved;
+ }
+
async updateEncryptedForUser(
userId: string,
hostId: number,
diff --git a/src/backend/database/repositories/host-resolution-repository.ts b/src/backend/database/repositories/host-resolution-repository.ts
index 83013185e..811d23395 100644
--- a/src/backend/database/repositories/host-resolution-repository.ts
+++ b/src/backend/database/repositories/host-resolution-repository.ts
@@ -112,6 +112,19 @@ export class HostResolutionRepository {
return this.decryptOne("ssh_data", rows[0], userId);
}
+ async findHostIdBySyncIdForUser(
+ syncId: string,
+ userId: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select({ id: hosts.id })
+ .from(hosts)
+ .where(and(eq(hosts.syncId, syncId), eq(hosts.userId, userId)))
+ .limit(1);
+
+ return rows[0]?.id ?? null;
+ }
+
async findHostUpdateState(
hostId: number,
): Promise {
diff --git a/src/backend/database/repositories/plugin-install-count-repository.ts b/src/backend/database/repositories/plugin-install-count-repository.ts
new file mode 100644
index 000000000..d97394f1f
--- /dev/null
+++ b/src/backend/database/repositories/plugin-install-count-repository.ts
@@ -0,0 +1,98 @@
+import { and, eq } from "drizzle-orm";
+import { pluginInstallCounts } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { rowsAffected } from "./mutation-result.js";
+import { insertReturning, updateReturning } from "./returning.js";
+
+export type PluginInstallCountRecord = typeof pluginInstallCounts.$inferSelect;
+
+export interface PluginInstallCountUpsertInput {
+ pluginId: string;
+ registryId: string;
+ count: number;
+ source?: string;
+}
+
+export class PluginInstallCountRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async listByPlugin(pluginId: string): Promise {
+ return this.context.drizzle
+ .select()
+ .from(pluginInstallCounts)
+ .where(eq(pluginInstallCounts.pluginId, pluginId));
+ }
+
+ async findByPluginAndRegistry(
+ pluginId: string,
+ registryId: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(pluginInstallCounts)
+ .where(
+ and(
+ eq(pluginInstallCounts.pluginId, pluginId),
+ eq(pluginInstallCounts.registryId, registryId),
+ ),
+ )
+ .limit(1);
+
+ return rows[0] ?? null;
+ }
+
+ async upsert(
+ input: PluginInstallCountUpsertInput,
+ now = new Date().toISOString(),
+ ): Promise {
+ const existing = await this.findByPluginAndRegistry(
+ input.pluginId,
+ input.registryId,
+ );
+
+ if (existing) {
+ const [updated] = await updateReturning(
+ this.context,
+ pluginInstallCounts,
+ {
+ count: input.count,
+ source: input.source ?? existing.source,
+ updatedAt: now,
+ },
+ eq(pluginInstallCounts.id, existing.id),
+ );
+
+ await this.afterWrite();
+ return updated;
+ }
+
+ const [created] = await insertReturning(this.context, pluginInstallCounts, {
+ pluginId: input.pluginId,
+ registryId: input.registryId,
+ count: input.count,
+ source: input.source ?? "aggregate-telemetry",
+ updatedAt: now,
+ });
+
+ await this.afterWrite();
+ return created;
+ }
+
+ async deleteByPlugin(pluginId: string): Promise {
+ const result = await this.context.drizzle
+ .delete(pluginInstallCounts)
+ .where(eq(pluginInstallCounts.pluginId, pluginId));
+
+ if (rowsAffected(result) > 0) {
+ await this.afterWrite();
+ }
+ return rowsAffected(result);
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/plugin-permission-grant-repository.ts b/src/backend/database/repositories/plugin-permission-grant-repository.ts
new file mode 100644
index 000000000..a21a5e757
--- /dev/null
+++ b/src/backend/database/repositories/plugin-permission-grant-repository.ts
@@ -0,0 +1,95 @@
+import { and, eq } from "drizzle-orm";
+import { pluginPermissionGrants } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { rowsAffected } from "./mutation-result.js";
+import { insertReturning } from "./returning.js";
+
+export type PluginPermissionGrantRecord =
+ typeof pluginPermissionGrants.$inferSelect;
+
+export interface PluginPermissionGrantCreateInput {
+ pluginId: string;
+ capability: string;
+ grantedBy: string;
+}
+
+export class PluginPermissionGrantRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async listByPlugin(pluginId: string): Promise {
+ return this.context.drizzle
+ .select()
+ .from(pluginPermissionGrants)
+ .where(eq(pluginPermissionGrants.pluginId, pluginId));
+ }
+
+ async findGrant(
+ pluginId: string,
+ capability: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(pluginPermissionGrants)
+ .where(
+ and(
+ eq(pluginPermissionGrants.pluginId, pluginId),
+ eq(pluginPermissionGrants.capability, capability),
+ ),
+ )
+ .limit(1);
+
+ return rows[0] ?? null;
+ }
+
+ async grant(
+ input: PluginPermissionGrantCreateInput,
+ now = new Date().toISOString(),
+ ): Promise {
+ const [created] = await insertReturning(
+ this.context,
+ pluginPermissionGrants,
+ {
+ pluginId: input.pluginId,
+ capability: input.capability,
+ grantedBy: input.grantedBy,
+ grantedAt: now,
+ },
+ );
+
+ await this.afterWrite();
+ return created;
+ }
+
+ async revoke(pluginId: string, capability: string): Promise {
+ const result = await this.context.drizzle
+ .delete(pluginPermissionGrants)
+ .where(
+ and(
+ eq(pluginPermissionGrants.pluginId, pluginId),
+ eq(pluginPermissionGrants.capability, capability),
+ ),
+ );
+
+ const affected = rowsAffected(result) > 0;
+ if (affected) await this.afterWrite();
+ return affected;
+ }
+
+ async deleteByPlugin(pluginId: string): Promise {
+ const result = await this.context.drizzle
+ .delete(pluginPermissionGrants)
+ .where(eq(pluginPermissionGrants.pluginId, pluginId));
+
+ if (rowsAffected(result) > 0) {
+ await this.afterWrite();
+ }
+ return rowsAffected(result);
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/plugin-registry-repository.ts b/src/backend/database/repositories/plugin-registry-repository.ts
new file mode 100644
index 000000000..dd5cc5d76
--- /dev/null
+++ b/src/backend/database/repositories/plugin-registry-repository.ts
@@ -0,0 +1,129 @@
+import { eq } from "drizzle-orm";
+import { pluginRegistries } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { rowsAffected } from "./mutation-result.js";
+import {
+ deleteReturning,
+ insertReturning,
+ updateReturning,
+} from "./returning.js";
+
+export type PluginRegistryRecord = typeof pluginRegistries.$inferSelect;
+
+export interface PluginRegistryCreateInput {
+ id: string;
+ name: string;
+ url: string;
+ kind?: string;
+ enabled?: boolean;
+ signingKey?: string | null;
+}
+
+export interface PluginRegistryUpdateInput {
+ name?: string;
+ url?: string;
+ kind?: string;
+ enabled?: boolean;
+ signingKey?: string | null;
+ lastCheckedAt?: string | null;
+ lastIndexHash?: string | null;
+}
+
+export class PluginRegistryRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async listAll(): Promise {
+ return this.context.drizzle.select().from(pluginRegistries);
+ }
+
+ async findById(registryId: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(pluginRegistries)
+ .where(eq(pluginRegistries.id, registryId))
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async create(
+ input: PluginRegistryCreateInput,
+ ): Promise {
+ const [created] = await insertReturning(this.context, pluginRegistries, {
+ id: input.id,
+ name: input.name,
+ url: input.url,
+ kind: input.kind ?? "community",
+ enabled: input.enabled ?? true,
+ signingKey: input.signingKey ?? null,
+ });
+
+ await this.afterWrite();
+ return created;
+ }
+
+ async update(
+ registryId: string,
+ input: PluginRegistryUpdateInput,
+ ): Promise {
+ const existing = await this.findById(registryId);
+ if (!existing) return null;
+
+ const [updated] = await updateReturning(
+ this.context,
+ pluginRegistries,
+ {
+ name: input.name ?? existing.name,
+ url: input.url ?? existing.url,
+ kind: input.kind ?? existing.kind,
+ enabled: input.enabled ?? existing.enabled,
+ signingKey:
+ input.signingKey === undefined
+ ? existing.signingKey
+ : input.signingKey,
+ lastCheckedAt:
+ input.lastCheckedAt === undefined
+ ? existing.lastCheckedAt
+ : input.lastCheckedAt,
+ lastIndexHash:
+ input.lastIndexHash === undefined
+ ? existing.lastIndexHash
+ : input.lastIndexHash,
+ },
+ eq(pluginRegistries.id, registryId),
+ );
+
+ await this.afterWrite();
+ return updated ?? null;
+ }
+
+ async delete(registryId: string): Promise {
+ const deleted = await deleteReturning(
+ this.context,
+ pluginRegistries,
+ eq(pluginRegistries.id, registryId),
+ );
+
+ if (deleted.length > 0) {
+ await this.afterWrite();
+ return true;
+ }
+ return false;
+ }
+
+ async deleteAll(): Promise {
+ const all = await this.listAll();
+ const result = await this.context.drizzle.delete(pluginRegistries);
+
+ if (rowsAffected(result) > 0) {
+ await this.afterWrite();
+ }
+ return all.length;
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/plugin-repository.ts b/src/backend/database/repositories/plugin-repository.ts
new file mode 100644
index 000000000..949edd479
--- /dev/null
+++ b/src/backend/database/repositories/plugin-repository.ts
@@ -0,0 +1,136 @@
+import { eq } from "drizzle-orm";
+import { plugins } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { rowsAffected } from "./mutation-result.js";
+import {
+ deleteReturning,
+ insertReturning,
+ updateReturning,
+} from "./returning.js";
+
+export type PluginRecord = typeof plugins.$inferSelect;
+
+export interface PluginCreateInput {
+ id: string;
+ name: string;
+ version: string;
+ tier?: string;
+ source?: string;
+ registryId?: string | null;
+ state?: string;
+ autoUpdate?: boolean;
+ manifestJson: string;
+}
+
+export interface PluginUpdateInput {
+ name?: string;
+ version?: string;
+ tier?: string;
+ source?: string;
+ registryId?: string | null;
+ state?: string;
+ autoUpdate?: boolean;
+ manifestJson?: string;
+}
+
+export class PluginRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async listAll(): Promise {
+ return this.context.drizzle.select().from(plugins);
+ }
+
+ async findById(pluginId: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(plugins)
+ .where(eq(plugins.id, pluginId))
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async create(
+ input: PluginCreateInput,
+ now = new Date().toISOString(),
+ ): Promise {
+ const [created] = await insertReturning(this.context, plugins, {
+ id: input.id,
+ name: input.name,
+ version: input.version,
+ tier: input.tier ?? "available",
+ source: input.source ?? "community",
+ registryId: input.registryId ?? null,
+ state: input.state ?? "disabled",
+ autoUpdate: input.autoUpdate ?? false,
+ manifestJson: input.manifestJson,
+ installedAt: now,
+ updatedAt: now,
+ });
+
+ await this.afterWrite();
+ return created;
+ }
+
+ async update(
+ pluginId: string,
+ input: PluginUpdateInput,
+ now = new Date().toISOString(),
+ ): Promise {
+ const existing = await this.findById(pluginId);
+ if (!existing) return null;
+
+ const [updated] = await updateReturning(
+ this.context,
+ plugins,
+ {
+ name: input.name ?? existing.name,
+ version: input.version ?? existing.version,
+ tier: input.tier ?? existing.tier,
+ source: input.source ?? existing.source,
+ registryId:
+ input.registryId === undefined
+ ? existing.registryId
+ : input.registryId,
+ state: input.state ?? existing.state,
+ autoUpdate: input.autoUpdate ?? existing.autoUpdate,
+ manifestJson: input.manifestJson ?? existing.manifestJson,
+ updatedAt: now,
+ },
+ eq(plugins.id, pluginId),
+ );
+
+ await this.afterWrite();
+ return updated ?? null;
+ }
+
+ async delete(pluginId: string): Promise {
+ const deleted = await deleteReturning(
+ this.context,
+ plugins,
+ eq(plugins.id, pluginId),
+ );
+
+ if (deleted.length > 0) {
+ await this.afterWrite();
+ return true;
+ }
+ return false;
+ }
+
+ async deleteAll(): Promise {
+ const all = await this.listAll();
+ const result = await this.context.drizzle.delete(plugins);
+
+ if (rowsAffected(result) > 0) {
+ await this.afterWrite();
+ }
+ return all.length;
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/rbac-access-repository.ts b/src/backend/database/repositories/rbac-access-repository.ts
index cc3f04707..3b2e8aa23 100644
--- a/src/backend/database/repositories/rbac-access-repository.ts
+++ b/src/backend/database/repositories/rbac-access-repository.ts
@@ -207,6 +207,18 @@ export class RbacAccessRepository {
return rowsAffected(result);
}
+ /** Grants the departing user handed out now count as the successor's. */
+ async reassignHostAccessGrantedBy(
+ fromUserId: string,
+ toUserId: string,
+ ): Promise {
+ await this.context.drizzle
+ .update(hostAccess)
+ .set({ grantedBy: toUserId })
+ .where(eq(hostAccess.grantedBy, fromUserId));
+ await this.afterWrite();
+ }
+
async deleteHostAccessForUserReferences(userId: string): Promise {
const directResult = await this.context.drizzle
.delete(hostAccess)
diff --git a/src/backend/database/repositories/role-repository.ts b/src/backend/database/repositories/role-repository.ts
index 3790f2389..78059d41b 100644
--- a/src/backend/database/repositories/role-repository.ts
+++ b/src/backend/database/repositories/role-repository.ts
@@ -1,5 +1,5 @@
import { and, eq, inArray } from "drizzle-orm";
-import { hostAccess, roles, userRoles } from "../db/schema.js";
+import { hostAccess, roles, userRoles, users } from "../db/schema.js";
import type { DatabaseContext } from "./database-context.js";
import { rowsAffected } from "./mutation-result.js";
import { deleteReturning, insertReturning } from "./returning.js";
@@ -8,7 +8,7 @@ export type RoleRecord = typeof roles.$inferSelect;
export type NewRoleRecord = typeof roles.$inferInsert;
export type RoleUpdate = Pick<
Partial,
- "displayName" | "description" | "updatedAt"
+ "displayName" | "description" | "permissions" | "updatedAt"
>;
export type UserRoleWithRole = {
@@ -21,6 +21,13 @@ export type UserRoleWithRole = {
grantedAt: string;
};
+export type RoleMemberRecord = {
+ userId: string;
+ username: string;
+ grantedAt: string;
+ grantedBy: string | null;
+};
+
export type UserRolePermissionRecord = {
permissions: string | null;
};
@@ -226,6 +233,20 @@ export class RoleRepository {
return rows.map((row) => row.userId);
}
+ async listRoleMembers(roleId: number): Promise {
+ return this.context.drizzle
+ .select({
+ userId: userRoles.userId,
+ username: users.username,
+ grantedAt: userRoles.grantedAt,
+ grantedBy: userRoles.grantedBy,
+ })
+ .from(userRoles)
+ .innerJoin(users, eq(userRoles.userId, users.id))
+ .where(eq(userRoles.roleId, roleId))
+ .orderBy(users.username);
+ }
+
async listUserRolePermissions(
userId: string,
): Promise {
diff --git a/src/backend/database/repositories/secret-source-repository.ts b/src/backend/database/repositories/secret-source-repository.ts
new file mode 100644
index 000000000..0cc77a421
--- /dev/null
+++ b/src/backend/database/repositories/secret-source-repository.ts
@@ -0,0 +1,135 @@
+import { desc, eq, or } from "drizzle-orm";
+import { secretSources } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+import { insertReturning } from "./returning.js";
+import { DataCrypto } from "../../utils/data-crypto.js";
+import { FieldCrypto } from "../../utils/field-crypto.js";
+
+export type SecretSourceRecord = typeof secretSources.$inferSelect;
+export type SecretSourceKind = "onepassword-connect";
+
+/** A row with the token still encrypted - safe to hand to the API. */
+export type SecretSourcePublic = Omit & {
+ hasToken: boolean;
+};
+
+export interface SecretSourceCreateInput {
+ id: string;
+ userId: string;
+ name: string;
+ kind: SecretSourceKind;
+ baseUrl: string;
+ token: string;
+ shared: boolean;
+}
+
+export interface SecretSourceUpdateInput {
+ name?: string;
+ baseUrl?: string;
+ token?: string;
+ shared?: boolean;
+}
+
+export function toPublicSecretSource(
+ row: SecretSourceRecord,
+): SecretSourcePublic {
+ const { token, ...rest } = row;
+ return { ...rest, hasToken: token.length > 0 };
+}
+
+/**
+ * The token is encrypted with the owner's data key under the row id, like
+ * vault_tokens - so a shared source only decrypts while its owner's key is
+ * loaded, which the resolver reports as a clear error.
+ */
+export class SecretSourceRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ private encryptToken(id: string, ownerId: string, token: string): string {
+ const key = DataCrypto.validateUserAccess(ownerId);
+ return FieldCrypto.encryptField(token, key, id, "token");
+ }
+
+ decryptToken(row: SecretSourceRecord): string {
+ const key = DataCrypto.getUserDataKey(row.userId);
+ if (!key) {
+ throw new Error(
+ "The secret source owner's data is locked; they need to sign in first",
+ );
+ }
+ return FieldCrypto.decryptField(row.token, key, row.id, "token");
+ }
+
+ async listVisibleToUser(userId: string): Promise {
+ return this.context.drizzle
+ .select()
+ .from(secretSources)
+ .where(
+ or(eq(secretSources.userId, userId), eq(secretSources.shared, true)),
+ )
+ .orderBy(desc(secretSources.updatedAt));
+ }
+
+ async findById(id: string): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(secretSources)
+ .where(eq(secretSources.id, id))
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async create(input: SecretSourceCreateInput): Promise {
+ const [created] = await insertReturning(this.context, secretSources, {
+ id: input.id,
+ userId: input.userId,
+ name: input.name,
+ kind: input.kind,
+ baseUrl: input.baseUrl,
+ token: this.encryptToken(input.id, input.userId, input.token),
+ shared: input.shared,
+ });
+ await this.afterWrite();
+ return created;
+ }
+
+ async update(
+ row: SecretSourceRecord,
+ input: SecretSourceUpdateInput,
+ ): Promise {
+ await this.context.drizzle
+ .update(secretSources)
+ .set({
+ ...(input.name !== undefined ? { name: input.name } : {}),
+ ...(input.baseUrl !== undefined ? { baseUrl: input.baseUrl } : {}),
+ ...(input.shared !== undefined ? { shared: input.shared } : {}),
+ ...(input.token !== undefined
+ ? { token: this.encryptToken(row.id, row.userId, input.token) }
+ : {}),
+ updatedAt: new Date().toISOString(),
+ })
+ .where(eq(secretSources.id, row.id));
+ await this.afterWrite();
+ }
+
+ async deleteById(id: string): Promise {
+ await this.context.drizzle
+ .delete(secretSources)
+ .where(eq(secretSources.id, id));
+ await this.afterWrite();
+ }
+
+ async deleteByUserId(userId: string): Promise {
+ await this.context.drizzle
+ .delete(secretSources)
+ .where(eq(secretSources.userId, userId));
+ await this.afterWrite();
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/session-share-repository.ts b/src/backend/database/repositories/session-share-repository.ts
index 39a8495b5..3a8dcfef3 100644
--- a/src/backend/database/repositories/session-share-repository.ts
+++ b/src/backend/database/repositories/session-share-repository.ts
@@ -13,7 +13,9 @@ export type SessionShareRecord = typeof sessionShares.$inferSelect;
export type SessionShareParticipantRecord =
typeof sessionShareParticipants.$inferSelect;
-export type SessionShareType = "link" | "user";
+// "room" shares are minted internally by the collab-room routes and are
+// joinable by any member of the room whose stage references them.
+export type SessionShareType = "link" | "user" | "room";
export type SessionSharePermissionLevel = "read-only" | "read-write";
export interface SessionShareCreateInput {
diff --git a/src/backend/database/repositories/shared-credential-secrets-repository.ts b/src/backend/database/repositories/shared-credential-secrets-repository.ts
new file mode 100644
index 000000000..3e8387d6e
--- /dev/null
+++ b/src/backend/database/repositories/shared-credential-secrets-repository.ts
@@ -0,0 +1,90 @@
+import { and, eq, inArray } from "drizzle-orm";
+import { credentialAccess, sharedCredentialSecrets } from "../db/schema.js";
+import type { DatabaseContext } from "./database-context.js";
+
+export type SharedCredentialSecretRecord =
+ typeof sharedCredentialSecrets.$inferSelect;
+export type NewSharedCredentialSecretRecord =
+ typeof sharedCredentialSecrets.$inferInsert;
+
+export class SharedCredentialSecretsRepository {
+ constructor(
+ private readonly context: DatabaseContext,
+ private readonly onWrite?: () => void | Promise,
+ ) {}
+
+ async upsert(record: NewSharedCredentialSecretRecord): Promise {
+ const existing = await this.context.drizzle
+ .select({ id: sharedCredentialSecrets.id })
+ .from(sharedCredentialSecrets)
+ .where(
+ and(
+ eq(
+ sharedCredentialSecrets.credentialAccessId,
+ record.credentialAccessId,
+ ),
+ eq(sharedCredentialSecrets.targetUserId, record.targetUserId),
+ ),
+ )
+ .limit(1);
+ if (existing[0]) {
+ await this.context.drizzle
+ .update(sharedCredentialSecrets)
+ .set({ ...record, updatedAt: new Date().toISOString() })
+ .where(eq(sharedCredentialSecrets.id, existing[0].id));
+ } else {
+ await this.context.drizzle.insert(sharedCredentialSecrets).values(record);
+ }
+ await this.afterWrite();
+ }
+
+ /** The recipient's snapshot for a credential, whichever grant produced it. */
+ async findForCredentialUser(
+ credentialId: number,
+ targetUserId: string,
+ ): Promise {
+ const rows = await this.context.drizzle
+ .select()
+ .from(sharedCredentialSecrets)
+ .where(
+ and(
+ eq(sharedCredentialSecrets.credentialId, credentialId),
+ eq(sharedCredentialSecrets.targetUserId, targetUserId),
+ ),
+ )
+ .limit(1);
+ return rows[0] ?? null;
+ }
+
+ async deleteForRoleMember(
+ roleId: number,
+ targetUserId: string,
+ ): Promise {
+ const grants = await this.context.drizzle
+ .select({ id: credentialAccess.id })
+ .from(credentialAccess)
+ .where(eq(credentialAccess.roleId, roleId));
+ if (grants.length === 0) return;
+ await this.context.drizzle.delete(sharedCredentialSecrets).where(
+ and(
+ inArray(
+ sharedCredentialSecrets.credentialAccessId,
+ grants.map((g) => g.id),
+ ),
+ eq(sharedCredentialSecrets.targetUserId, targetUserId),
+ ),
+ );
+ await this.afterWrite();
+ }
+
+ async deleteByTargetUserId(userId: string): Promise {
+ await this.context.drizzle
+ .delete(sharedCredentialSecrets)
+ .where(eq(sharedCredentialSecrets.targetUserId, userId));
+ await this.afterWrite();
+ }
+
+ private async afterWrite(): Promise {
+ await this.onWrite?.();
+ }
+}
diff --git a/src/backend/database/repositories/shared-host-auth-override-repository.ts b/src/backend/database/repositories/shared-host-auth-override-repository.ts
index 653c50fb5..eb290886b 100644
--- a/src/backend/database/repositories/shared-host-auth-override-repository.ts
+++ b/src/backend/database/repositories/shared-host-auth-override-repository.ts
@@ -33,6 +33,33 @@ export class SharedHostAuthOverrideRepository {
return rows[0] ?? null;
}
+ /** Recipient overrides for a host keyed by protocol, in one query. */
+ async listCredentialIds(
+ hostId: number,
+ userId: string,
+ ): Promise>> {
+ const rows = await this.context.drizzle
+ .select({
+ protocol: sharedHostAuthOverrides.protocol,
+ credentialId: sharedHostAuthOverrides.credentialId,
+ })
+ .from(sharedHostAuthOverrides)
+ .where(
+ and(
+ eq(sharedHostAuthOverrides.hostId, hostId),
+ eq(sharedHostAuthOverrides.userId, userId),
+ ),
+ );
+
+ const result: Partial> = {};
+ for (const row of rows) {
+ if (row.credentialId) {
+ result[row.protocol as AuthOverrideProtocol] = row.credentialId;
+ }
+ }
+ return result;
+ }
+
async findCredentialId(
hostId: number,
userId: string,
diff --git a/src/backend/database/repositories/snippet-repository.ts b/src/backend/database/repositories/snippet-repository.ts
index 32b3d56c4..2d3625b9d 100644
--- a/src/backend/database/repositories/snippet-repository.ts
+++ b/src/backend/database/repositories/snippet-repository.ts
@@ -1,4 +1,4 @@
-import { and, asc, eq, sql } from "drizzle-orm";
+import { and, asc, eq, like, or, sql } from "drizzle-orm";
import { randomUUID } from "crypto";
import { snippetFolders, snippets } from "../db/schema.js";
import type { DatabaseContext } from "./database-context.js";
@@ -108,6 +108,25 @@ export class SnippetRepository {
return this.listFolders(userId);
}
+ /** Snippets in a folder or any of its subfolders ("Parent / Child"). */
+ async listOwnedSnippetsInFolder(
+ userId: string,
+ folder: string,
+ ): Promise {
+ return this.context.drizzle
+ .select()
+ .from(snippets)
+ .where(
+ and(
+ eq(snippets.userId, userId),
+ or(
+ eq(snippets.folder, folder),
+ like(snippets.folder, `${folder} / %`),
+ ),
+ ),
+ );
+ }
+
async listOwnedSnippets(userId: string): Promise {
return this.context.drizzle
.select()
diff --git a/src/backend/database/routes/automations.ts b/src/backend/database/routes/automations.ts
index a2a81c6c3..1aca7ca11 100644
--- a/src/backend/database/routes/automations.ts
+++ b/src/backend/database/routes/automations.ts
@@ -7,6 +7,7 @@ import type {
Trigger,
} from "../../../types/automations.js";
import { AUTOMATION_DEFINITION_VERSION } from "../../../types/automations.js";
+import { PermissionManager } from "../../utils/permission-manager.js";
import { AuthManager } from "../../utils/auth-manager.js";
import { databaseLogger } from "../../utils/logger.js";
import {
@@ -26,6 +27,7 @@ import {
const router = express.Router();
const authManager = AuthManager.getInstance();
+const permissionManager = PermissionManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
const requireDataAccess = authManager.createDataAccessMiddleware();
@@ -244,6 +246,7 @@ async function syncSchedule(
router.get(
"/",
authenticateJWT,
+ permissionManager.requirePermission("automations.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -282,6 +285,7 @@ router.get(
router.get(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("automations.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -333,6 +337,7 @@ router.get(
router.post(
"/",
authenticateJWT,
+ permissionManager.requirePermission("automations.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -423,6 +428,7 @@ router.post(
router.put(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("automations.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -531,6 +537,7 @@ router.put(
router.delete(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("automations.delete"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -600,6 +607,7 @@ router.delete(
router.post(
"/:id/run",
authenticateJWT,
+ permissionManager.requirePermission("automations.run"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -673,6 +681,7 @@ router.post(
router.get(
"/runs/history",
authenticateJWT,
+ permissionManager.requirePermission("automations.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -715,6 +724,7 @@ router.get(
router.get(
"/runs/:runId/steps",
authenticateJWT,
+ permissionManager.requirePermission("automations.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
diff --git a/src/backend/database/routes/branding-routes.ts b/src/backend/database/routes/branding-routes.ts
new file mode 100644
index 000000000..da30d147a
--- /dev/null
+++ b/src/backend/database/routes/branding-routes.ts
@@ -0,0 +1,165 @@
+import type { Request, RequestHandler, Response, Router } from "express";
+import { databaseLogger } from "../../utils/logger.js";
+import { createCurrentSettingsRepository } from "../repositories/factory.js";
+import {
+ BRANDING_KEYS,
+ parseBrandingAppName,
+ parseBrandingLogoDataUrl,
+ parseBrandingTagline,
+ resolveBrandingSettings,
+} from "./branding-settings.js";
+
+const PATCHABLE_FIELDS = ["appName", "tagline", "logo"] as const;
+type PatchableField = (typeof PATCHABLE_FIELDS)[number];
+
+function invalidField(res: Response, field: string): void {
+ res.status(400).json({
+ error: `Invalid value for ${field}`,
+ code: "BRANDING_SETTINGS_INVALID",
+ field,
+ });
+}
+
+/**
+ * Validates a PATCH body and returns the settings-table writes/deletes it
+ * implies, or null after the response has already been failed with a 400.
+ * `logo: null` clears the custom logo (falls back to the bundled default).
+ */
+async function buildBrandingWrites(
+ body: unknown,
+ res: Response,
+): Promise<{
+ writes: Array<{ key: string; value: string }>;
+ deletes: string[];
+} | null> {
+ if (typeof body !== "object" || body === null || Array.isArray(body)) {
+ res.status(400).json({
+ error: "Invalid request body",
+ code: "BRANDING_SETTINGS_INVALID",
+ });
+ return null;
+ }
+
+ for (const field of Object.keys(body)) {
+ if (!(PATCHABLE_FIELDS as readonly string[]).includes(field)) {
+ res.status(400).json({
+ error: `Unknown setting field: ${field}`,
+ code: "BRANDING_SETTINGS_UNKNOWN_FIELD",
+ field,
+ });
+ return null;
+ }
+ }
+
+ const input = body as Partial>;
+ const writes: Array<{ key: string; value: string }> = [];
+ const deletes: string[] = [];
+
+ if (input.appName !== undefined) {
+ const appName = parseBrandingAppName(input.appName);
+ if (appName === null) {
+ invalidField(res, "appName");
+ return null;
+ }
+ writes.push({ key: BRANDING_KEYS.appName, value: appName });
+ }
+
+ if (input.tagline !== undefined) {
+ const tagline = parseBrandingTagline(input.tagline);
+ if (tagline === null) {
+ invalidField(res, "tagline");
+ return null;
+ }
+ writes.push({ key: BRANDING_KEYS.tagline, value: tagline });
+ }
+
+ if (input.logo !== undefined) {
+ if (input.logo === null) {
+ deletes.push(BRANDING_KEYS.logo);
+ } else {
+ const logo = await parseBrandingLogoDataUrl(input.logo);
+ if (logo === null) {
+ invalidField(res, "logo");
+ return null;
+ }
+ writes.push({ key: BRANDING_KEYS.logo, value: logo });
+ }
+ }
+
+ return { writes, deletes };
+}
+
+export function registerBrandingRoutes(
+ router: Router,
+ requireAdmin: RequestHandler,
+): void {
+ /**
+ * @openapi
+ * /users/branding:
+ * get:
+ * summary: Get white-label branding
+ * description: Returns the effective app name, tagline and logo. Public (no auth) so the pre-login screen and app bootstrap can apply branding before any session exists.
+ * tags:
+ * - Users
+ * responses:
+ * 200:
+ * description: Effective branding settings.
+ * 500:
+ * description: Failed to load branding settings.
+ */
+ router.get("/branding", async (_req: Request, res: Response) => {
+ try {
+ const settings = await resolveBrandingSettings(
+ createCurrentSettingsRepository(),
+ );
+ res.json(settings);
+ } catch (err) {
+ databaseLogger.error("Failed to load branding settings", err);
+ res.status(500).json({ error: "Failed to load branding settings" });
+ }
+ });
+
+ /**
+ * @openapi
+ * /users/branding:
+ * patch:
+ * summary: Update white-label branding (admin only)
+ * description: Persists a partial update to appName, tagline and/or logo (a PNG/JPEG/WEBP data URL; pass null to clear the logo). Invalid values are rejected with a 400.
+ * tags:
+ * - Users
+ * responses:
+ * 200:
+ * description: Updated effective branding settings.
+ * 400:
+ * description: Invalid or unknown setting field.
+ * 401:
+ * description: Not authenticated.
+ * 403:
+ * description: Admin access required.
+ * 500:
+ * description: Failed to save branding settings.
+ */
+ router.patch(
+ "/branding",
+ requireAdmin,
+ async (req: Request, res: Response) => {
+ const result = await buildBrandingWrites(req.body, res);
+ if (result === null) return;
+
+ try {
+ const settings = createCurrentSettingsRepository();
+ if (result.writes.length > 0) {
+ await settings.setMany(result.writes);
+ }
+ for (const key of result.deletes) {
+ await settings.delete(key);
+ }
+ const resolved = await resolveBrandingSettings(settings);
+ res.json(resolved);
+ } catch (err) {
+ databaseLogger.error("Failed to save branding settings", err);
+ res.status(500).json({ error: "Failed to save branding settings" });
+ }
+ },
+ );
+}
diff --git a/src/backend/database/routes/branding-settings.ts b/src/backend/database/routes/branding-settings.ts
new file mode 100644
index 000000000..883816587
--- /dev/null
+++ b/src/backend/database/routes/branding-settings.ts
@@ -0,0 +1,126 @@
+import sharp from "sharp";
+import { databaseLogger } from "../../utils/logger.js";
+
+/**
+ * White-label branding: admin-configurable app name, logo and tagline shown
+ * on the login screen and the browser tab. Persisted in the generic
+ * key/value `settings` table -- no schema migration needed.
+ */
+export interface BrandingSettings {
+ appName: string;
+ tagline: string;
+ /** PNG data URL, or null when no custom logo is configured. */
+ logo: string | null;
+}
+
+export const BRANDING_KEYS = {
+ appName: "branding_app_name",
+ tagline: "branding_tagline",
+ logo: "branding_logo",
+} as const;
+
+export const BRANDING_DEFAULT_APP_NAME = "Termix";
+const APP_NAME_MAX_LENGTH = 60;
+const TAGLINE_MAX_LENGTH = 160;
+
+/**
+ * Cap applies to the decoded image bytes, not the base64 text. The settings
+ * table is fully cached in memory per backend process (see
+ * settings-cache.ts), so an oversized logo would be permanently resident RAM
+ * on every instance, not just a one-time upload cost.
+ */
+export const BRANDING_LOGO_MAX_BYTES = 750 * 1024;
+const BRANDING_LOGO_MAX_INPUT_PIXELS = 20_000_000;
+
+interface SettingSource {
+ get(key: string): Promise;
+}
+
+export async function resolveBrandingSettings(
+ settings: SettingSource,
+): Promise {
+ const [appName, tagline, logo] = await Promise.all([
+ settings.get(BRANDING_KEYS.appName),
+ settings.get(BRANDING_KEYS.tagline),
+ settings.get(BRANDING_KEYS.logo),
+ ]);
+
+ return {
+ appName: appName?.trim() || BRANDING_DEFAULT_APP_NAME,
+ tagline: tagline ?? "",
+ logo: logo || null,
+ };
+}
+
+/** Trimmed, 1-60 chars. Falls back to the default when cleared. */
+export function parseBrandingAppName(value: unknown): string | null {
+ if (typeof value !== "string") return null;
+ const trimmed = value.trim();
+ if (trimmed.length === 0) return BRANDING_DEFAULT_APP_NAME;
+ if (trimmed.length > APP_NAME_MAX_LENGTH) return null;
+ return trimmed;
+}
+
+/** Trimmed, 0-160 chars. An empty string means "use the built-in default". */
+export function parseBrandingTagline(value: unknown): string | null {
+ if (typeof value !== "string") return null;
+ const trimmed = value.trim();
+ if (trimmed.length > TAGLINE_MAX_LENGTH) return null;
+ return trimmed;
+}
+
+/**
+ * Validates and re-encodes an uploaded logo. Only raster formats are
+ * accepted (no SVG), sidestepping SVG-script XSS entirely rather than trying
+ * to sanitize markup. The image is always re-encoded to PNG through sharp:
+ * this both proves the payload is a genuine image (not a disguised file
+ * behind a spoofed data-URL prefix) and strips any embedded metadata.
+ *
+ * Returns null on any validation failure; the caller is expected to reject
+ * the request with a 400 without echoing back details of what was rejected.
+ */
+export async function parseBrandingLogoDataUrl(
+ value: unknown,
+): Promise {
+ if (typeof value !== "string") return null;
+ const match = value.match(
+ /^data:image\/(png|jpe?g|webp);base64,([a-zA-Z0-9+/]+=*)$/,
+ );
+ if (!match) return null;
+
+ const [, , base64] = match;
+ let buffer: Buffer;
+ try {
+ buffer = Buffer.from(base64, "base64");
+ } catch {
+ return null;
+ }
+ if (buffer.length === 0 || buffer.length > BRANDING_LOGO_MAX_BYTES * 4) {
+ // Reject wildly oversized input before decoding it with sharp; the final
+ // size check happens below on the re-encoded PNG.
+ return null;
+ }
+
+ try {
+ const source = sharp(buffer, {
+ failOn: "error",
+ limitInputPixels: BRANDING_LOGO_MAX_INPUT_PIXELS,
+ });
+ const metadata = await source.metadata();
+ if (
+ !metadata.format ||
+ !["png", "jpeg", "webp"].includes(metadata.format)
+ ) {
+ return null;
+ }
+ const normalized = await source.rotate().png().toBuffer();
+ if (normalized.length > BRANDING_LOGO_MAX_BYTES) return null;
+ return `data:image/png;base64,${normalized.toString("base64")}`;
+ } catch (err) {
+ databaseLogger.warn("Rejected invalid branding logo upload", {
+ operation: "branding_logo_invalid",
+ error: err instanceof Error ? err.message : String(err),
+ });
+ return null;
+ }
+}
diff --git a/src/backend/database/routes/credential-bulk-routes.ts b/src/backend/database/routes/credential-bulk-routes.ts
index 00583d5e8..448a7473d 100644
--- a/src/backend/database/routes/credential-bulk-routes.ts
+++ b/src/backend/database/routes/credential-bulk-routes.ts
@@ -6,6 +6,8 @@ import { createCurrentCredentialRepository } from "../repositories/factory.js";
export function registerCredentialBulkRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireEditPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -42,6 +44,8 @@ export function registerCredentialBulkRoutes(
router.put(
"/reorder",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { positions } = req.body as {
diff --git a/src/backend/database/routes/credential-deploy-routes.ts b/src/backend/database/routes/credential-deploy-routes.ts
index fdf986442..306abed20 100644
--- a/src/backend/database/routes/credential-deploy-routes.ts
+++ b/src/backend/database/routes/credential-deploy-routes.ts
@@ -359,6 +359,9 @@ async function deploySSHKeyToHost(
export function registerCredentialDeployRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireCredentialViewPermission: RequestHandler,
+ requireHostEditPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -398,6 +401,9 @@ export function registerCredentialDeployRoutes(
router.post(
"/:id/deploy-to-host",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireHostEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const id = Array.isArray(req.params.id)
? req.params.id[0]
diff --git a/src/backend/database/routes/credential-key-routes.ts b/src/backend/database/routes/credential-key-routes.ts
index 0d912789b..5cc72b238 100644
--- a/src/backend/database/routes/credential-key-routes.ts
+++ b/src/backend/database/routes/credential-key-routes.ts
@@ -63,6 +63,8 @@ function generateSSHKeyPair(
export function registerCredentialKeyRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireCredentialViewPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -94,6 +96,8 @@ export function registerCredentialKeyRoutes(
router.post(
"/detect-key-type",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const { privateKey, keyPassword } = req.body;
@@ -150,6 +154,8 @@ export function registerCredentialKeyRoutes(
router.post(
"/detect-public-key-type",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const { publicKey } = req.body;
@@ -209,6 +215,8 @@ export function registerCredentialKeyRoutes(
router.post(
"/validate-key-pair",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const { privateKey, publicKey, keyPassword } = req.body;
@@ -274,6 +282,8 @@ export function registerCredentialKeyRoutes(
router.post(
"/generate-key-pair",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const { keyType = "ssh-ed25519", keySize = 2048, passphrase } = req.body;
@@ -339,6 +349,8 @@ export function registerCredentialKeyRoutes(
router.post(
"/generate-public-key",
authenticateJWT,
+ requireCredentialViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const { privateKey, keyPassword } = req.body;
diff --git a/src/backend/database/routes/credentials.ts b/src/backend/database/routes/credentials.ts
index ab6ad60e0..31193bfa9 100644
--- a/src/backend/database/routes/credentials.ts
+++ b/src/backend/database/routes/credentials.ts
@@ -2,6 +2,7 @@ import { getErrorMessage } from "../../utils/error-message.js";
import type { AuthenticatedRequest } from "../../../types/index.js";
import express, { type Request, type Response } from "express";
import { authLogger } from "../../utils/logger.js";
+import { PermissionManager } from "../../utils/permission-manager.js";
import { AuthManager } from "../../utils/auth-manager.js";
import { parseSSHKey } from "../../utils/ssh-key-utils.js";
import { registerCredentialKeyRoutes } from "./credential-key-routes.js";
@@ -14,6 +15,9 @@ import {
} from "../../utils/audit-logger.js";
import {
createCurrentCredentialRepository,
+ createCurrentUserRepository,
+ createCurrentCredentialAccessRepository,
+ createCurrentRoleRepository,
createCurrentHostResolutionRepository,
createCurrentHostRepository,
createCurrentSyncTombstoneRepository,
@@ -26,6 +30,7 @@ function isNonEmptyString(val: unknown): val is string {
}
const authManager = AuthManager.getInstance();
+const permissionManager = PermissionManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
const requireDataAccess = authManager.createDataAccessMiddleware();
@@ -78,6 +83,7 @@ const requireDataAccess = authManager.createDataAccessMiddleware();
router.post(
"/",
authenticateJWT,
+ permissionManager.requirePermission("credentials.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -250,6 +256,7 @@ router.post(
router.get(
"/",
authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -262,8 +269,11 @@ router.get(
try {
const credentials =
await createCurrentCredentialRepository().listDecryptedByUserId(userId);
+ const own = credentials.map((cred) => formatCredentialOutput(cred));
- res.json(credentials.map((cred) => formatCredentialOutput(cred)));
+ // Credentials shared with this user, read from their own snapshots.
+ const shared = await listSharedCredentialsForUser(userId);
+ res.json([...own, ...shared]);
} catch (err) {
authLogger.error("Failed to fetch credentials", err);
res.status(500).json({ error: "Failed to fetch credentials" });
@@ -290,6 +300,7 @@ router.get(
router.get(
"/folders",
authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -311,7 +322,12 @@ router.get(
// Registered here (before the PUT /:id route below) so the literal
// "/reorder" path segment is matched before Express falls through to the
// PUT /:id param route and treats "reorder" as an id.
-registerCredentialBulkRoutes(router, authenticateJWT);
+registerCredentialBulkRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.edit"),
+ requireDataAccess,
+);
/**
* @openapi
@@ -340,6 +356,7 @@ registerCredentialBulkRoutes(router, authenticateJWT);
router.get(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -351,11 +368,14 @@ router.get(
}
try {
+ const credentialRepository = createCurrentCredentialRepository();
+ const ownCredential = await credentialRepository.findDecryptedByIdForUser(
+ userId,
+ parseInt(id),
+ );
const credential =
- await createCurrentCredentialRepository().findDecryptedByIdForUser(
- userId,
- parseInt(id),
- );
+ ownCredential ??
+ (await findSharedCredentialForUser(parseInt(id), userId));
if (!credential) {
return res.status(404).json({ error: "Credential not found" });
@@ -432,6 +452,7 @@ router.get(
router.post(
"/:id/duplicate",
authenticateJWT,
+ permissionManager.requirePermission("credentials.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -585,6 +606,7 @@ router.post(
router.put(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("credentials.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -604,13 +626,21 @@ router.put(
});
try {
- const existingCredential =
- await createCurrentCredentialRepository().findDecryptedByIdForUser(
- userId,
- credentialId,
- );
+ // A recipient holding "manage" edits the owner's row on the owner's
+ // behalf; the row stays encrypted under the owner's key and every
+ // recipient's snapshot is rebuilt below.
+ const editableOwnerId = await resolveEditableCredentialOwner(
+ credentialId,
+ userId,
+ );
+ const existingCredential = editableOwnerId
+ ? await createCurrentCredentialRepository().findDecryptedByIdForUser(
+ editableOwnerId,
+ credentialId,
+ )
+ : null;
- if (!existingCredential) {
+ if (!existingCredential || !editableOwnerId) {
return res.status(404).json({ error: "Credential not found" });
}
@@ -673,14 +703,14 @@ router.put(
const credentialRepository = createCurrentCredentialRepository();
const updated = await credentialRepository.updateEncryptedForUser(
- userId,
+ editableOwnerId,
credentialId,
updateFields,
);
const updatedCredential =
updated ??
(await credentialRepository.findDecryptedByIdForUser(
- userId,
+ editableOwnerId,
credentialId,
));
@@ -688,7 +718,13 @@ router.put(
await import("../../utils/shared-host-secrets-manager.js");
await SharedHostSecretsManager.getInstance().resyncHostsForCredential(
credentialId,
- userId,
+ editableOwnerId,
+ );
+ const { SharedCredentialSecretsManager } =
+ await import("../../utils/shared-credential-secrets-manager.js");
+ await SharedCredentialSecretsManager.getInstance().resyncCredential(
+ credentialId,
+ editableOwnerId,
);
authLogger.success("SSH credential updated", {
@@ -747,6 +783,7 @@ router.put(
router.delete(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("credentials.delete"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -878,6 +915,7 @@ router.delete(
router.post(
"/:id/apply-to-host/:hostId",
authenticateJWT,
+ permissionManager.requirePermission("credentials.edit"),
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const credentialId = Array.isArray(req.params.id)
@@ -958,6 +996,7 @@ router.post(
router.get(
"/:id/hosts",
authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const credentialId = Array.isArray(req.params.id)
@@ -986,6 +1025,78 @@ router.get(
},
);
+/** The owner id if the caller may edit this credential (owner or "manage"), else null. */
+async function resolveEditableCredentialOwner(
+ credentialId: number,
+ userId: string,
+): Promise {
+ const row = await createCurrentCredentialRepository().findById(credentialId);
+ if (!row) return null;
+ if (row.userId === userId) return userId;
+ const roleIds = await createCurrentRoleRepository().listUserRoleIds(userId);
+ const grant = await createCurrentCredentialAccessRepository().findActiveGrant(
+ credentialId,
+ userId,
+ roleIds,
+ );
+ return grant?.permissionLevel === "manage" ? row.userId : null;
+}
+
+async function findSharedCredentialForUser(
+ credentialId: number,
+ userId: string,
+): Promise | null> {
+ const shared = (await listSharedCredentialsForUser(userId)).find(
+ (cred) => cred.id === credentialId,
+ );
+ return shared ?? null;
+}
+
+/** Shared credentials shaped like the caller's own, plus who shared them. */
+async function listSharedCredentialsForUser(
+ userId: string,
+): Promise[]> {
+ const roleIds = await createCurrentRoleRepository().listUserRoleIds(userId);
+ const grants =
+ await createCurrentCredentialAccessRepository().listSharedWithUser(
+ userId,
+ roleIds,
+ );
+ if (grants.length === 0) return [];
+ const credentialRepository = createCurrentCredentialRepository();
+ const userRepository = createCurrentUserRepository();
+ const { findUsableCredential } =
+ await import("../../hosts/usable-credential.js");
+ const results: Record[] = [];
+ for (const grant of grants) {
+ const row = await credentialRepository.findById(grant.credentialId);
+ if (!row) continue;
+ let secrets: Record | null = null;
+ try {
+ secrets = (await findUsableCredential(
+ grant.credentialId,
+ userId,
+ )) as Record | null;
+ } catch {
+ secrets = null;
+ }
+ const owner = await userRepository.findById(grant.ownerId);
+ results.push({
+ ...formatCredentialOutput({
+ ...row,
+ username: secrets?.username ?? row.username,
+ publicKey: secrets?.publicKey ?? null,
+ certPublicKey: secrets?.certPublicKey ?? null,
+ }),
+ isShared: true,
+ ownerUsername: owner?.username ?? null,
+ permissionLevel: grant.permissionLevel,
+ sharedExpiresAt: grant.expiresAt,
+ });
+ }
+ return results;
+}
+
function formatCredentialOutput(
credential: Record,
): Record {
@@ -1076,6 +1187,7 @@ function formatSSHHostOutput(
router.put(
"/folders/rename",
authenticateJWT,
+ permissionManager.requirePermission("credentials.edit"),
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { oldName, newName } = req.body;
@@ -1107,8 +1219,19 @@ router.put(
},
);
-registerCredentialKeyRoutes(router, authenticateJWT);
+registerCredentialKeyRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
+ requireDataAccess,
+);
-registerCredentialDeployRoutes(router, authenticateJWT);
+registerCredentialDeployRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
+ permissionManager.requirePermission("hosts.edit"),
+ requireDataAccess,
+);
export default router;
diff --git a/src/backend/database/routes/delete-user-data.ts b/src/backend/database/routes/delete-user-data.ts
index 3c54983fe..e92eadbba 100644
--- a/src/backend/database/routes/delete-user-data.ts
+++ b/src/backend/database/routes/delete-user-data.ts
@@ -39,14 +39,34 @@ import {
createCurrentUserRepository,
createCurrentTransferRecentRepository,
createCurrentVaultProfileRepository,
+ createCurrentSecretSourceRepository,
+ createCurrentSharedCredentialSecretsRepository,
+ createCurrentCredentialAccessRepository,
createCurrentVaultTokenRepository,
} from "../repositories/factory.js";
-export async function deleteUserAndRelatedData(userId: string): Promise {
+export async function deleteUserAndRelatedData(
+ userId: string,
+ options: { successorUserId?: string } = {},
+): Promise {
try {
+ // With a successor, hosts and credentials (and the shares on them)
+ // change owner instead of disappearing with the account.
+ if (options.successorUserId) {
+ const { transferOwnership } =
+ await import("../../utils/transfer-ownership.js");
+ await transferOwnership(userId, options.successorUserId);
+ }
+
await createCurrentSharedHostSecretsRepository().deleteByTargetUserId(
userId,
);
+ await createCurrentSharedCredentialSecretsRepository().deleteByTargetUserId(
+ userId,
+ );
+ await createCurrentCredentialAccessRepository().deleteForUserReferences(
+ userId,
+ );
// Retained rather than deleted: these outlive the account by design.
// See anonymizeByUserId on each repository.
@@ -98,6 +118,7 @@ export async function deleteUserAndRelatedData(userId: string): Promise {
await createCurrentOpksshTokenRepository().deleteByUserId(userId);
await createCurrentVaultTokenRepository().deleteByUserId(userId);
await createCurrentVaultProfileRepository().deleteByUserId(userId);
+ await createCurrentSecretSourceRepository().deleteByUserId(userId);
await createCurrentTermixIdentityCaRepository().deleteByUserId(userId);
await createCurrentTermixIdentityRepository().deleteByUserId(userId);
await createCurrentTmuxSessionTagRepository().deleteByUserId(userId);
diff --git a/src/backend/database/routes/desktop-auto-session.ts b/src/backend/database/routes/desktop-auto-session.ts
index d1ffa95b0..af3d786b6 100644
--- a/src/backend/database/routes/desktop-auto-session.ts
+++ b/src/backend/database/routes/desktop-auto-session.ts
@@ -33,6 +33,11 @@ export function extractBearerOrCookieToken(req: Request): string | undefined {
return undefined;
}
+export function isNativeTokenExportRequest(req: Request): boolean {
+ const userAgent = req.get("user-agent") || "";
+ return /^(Termix-Mobile|Termix-Desktop)\//.test(userAgent);
+}
+
/**
* Decides who the desktop auto-session endpoint should silently log in as.
*
diff --git a/src/backend/database/routes/homepage-favicon-routes.ts b/src/backend/database/routes/homepage-favicon-routes.ts
index 77d3d3338..cbeddaa30 100644
--- a/src/backend/database/routes/homepage-favicon-routes.ts
+++ b/src/backend/database/routes/homepage-favicon-routes.ts
@@ -12,6 +12,7 @@ const faviconCache = new Map<
>();
const CACHE_SIZE = 100;
const CACHE_TTL_MS = 1000 * 60 * 60 * 24; // 24 hours
+const MAX_FAVICON_BYTES = 512 * 1024;
function evictIfNeeded() {
if (faviconCache.size >= CACHE_SIZE) {
@@ -25,14 +26,31 @@ function fetchUrl(url: string): Promise<{ data: Buffer; contentType: string }> {
const mod = url.startsWith("https") ? https : http;
const req = mod.get(url, { timeout: 5000 }, (res) => {
const chunks: Buffer[] = [];
- res.on("data", (chunk: Buffer) => chunks.push(chunk));
+ let bytes = 0;
+ let settled = false;
+ const fail = (error: Error) => {
+ if (settled) return;
+ settled = true;
+ res.destroy();
+ reject(error);
+ };
+ res.on("data", (chunk: Buffer) => {
+ bytes += chunk.length;
+ if (bytes > MAX_FAVICON_BYTES) {
+ fail(new Error("Favicon response too large"));
+ return;
+ }
+ chunks.push(chunk);
+ });
res.on("end", () => {
+ if (settled) return;
+ settled = true;
resolve({
data: Buffer.concat(chunks),
contentType: res.headers["content-type"] || "image/x-icon",
});
});
- res.on("error", reject);
+ res.on("error", fail);
});
req.on("error", reject);
req.on("timeout", () => {
@@ -95,7 +113,7 @@ homepageFaviconRouter.get("/", async (req: Request, res: Response) => {
res.setHeader("Content-Type", contentType);
res.setHeader("Cache-Control", "public, max-age=86400");
res.send(data);
- } catch (err) {
+ } catch {
homepageLogger.warn("Failed to fetch favicon", { domain });
res.status(500).json({ error: "Failed to fetch favicon" });
}
diff --git a/src/backend/database/routes/homepage-proxy-routes.ts b/src/backend/database/routes/homepage-proxy-routes.ts
index 930cc2bd8..ec92e99cb 100644
--- a/src/backend/database/routes/homepage-proxy-routes.ts
+++ b/src/backend/database/routes/homepage-proxy-routes.ts
@@ -1,11 +1,10 @@
import { getErrorMessage } from "../../utils/error-message.js";
import express, { type Request, type Response } from "express";
-import https from "https";
-import http from "http";
-import { lookup } from "dns/promises";
-import { isIP } from "net";
import { homepageLogger } from "../../utils/logger.js";
-import { isBlockedAddress } from "../../utils/safe-outbound-fetch.js";
+import {
+ readResponseTextLimited,
+ safeOutboundFetch,
+} from "../../utils/safe-outbound-fetch.js";
export const homepageProxyRouter = express.Router();
@@ -17,68 +16,20 @@ interface ProxyCacheEntry {
const proxyCache = new Map();
const CACHE_SIZE = 50;
const FETCH_TIMEOUT_MS = 8000;
-
-async function resolvePublicUrl(rawUrl: string): Promise<{
- url: URL;
- address: string;
-}> {
- const url = new URL(rawUrl);
- if (
- !["http:", "https:"].includes(url.protocol) ||
- url.username ||
- url.password
- ) {
- throw new Error("Invalid URL");
- }
-
- const hostname = url.hostname.replace(/^\[|\]$/g, "");
- const addresses = isIP(hostname)
- ? [{ address: hostname }]
- : await lookup(hostname, { all: true, verbatim: true });
- if (
- addresses.length === 0 ||
- addresses.some(({ address }) => isBlockedAddress(address))
- ) {
- throw new Error("Private destinations are not allowed");
- }
-
- return { url, address: addresses[0].address };
-}
+const MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
+const MAX_CACHE_TTL_SECONDS = 24 * 60 * 60;
async function fetchJson(rawUrl: string): Promise {
- const { url, address } = await resolvePublicUrl(rawUrl);
- return new Promise((resolve, reject) => {
- const mod = url.protocol === "https:" ? https : http;
- const req = mod.get(
- {
- protocol: url.protocol,
- hostname: address,
- port: url.port || undefined,
- path: `${url.pathname}${url.search}`,
- headers: { Host: url.host },
- servername: url.protocol === "https:" ? url.hostname : undefined,
- timeout: FETCH_TIMEOUT_MS,
- },
- (res) => {
- const chunks: Buffer[] = [];
- res.on("data", (chunk: Buffer) => chunks.push(chunk));
- res.on("end", () => {
- try {
- const text = Buffer.concat(chunks).toString("utf-8");
- resolve(JSON.parse(text));
- } catch {
- reject(new Error("Response is not valid JSON"));
- }
- });
- res.on("error", reject);
- },
- );
- req.on("error", reject);
- req.on("timeout", () => {
- req.destroy();
- reject(new Error("Fetch timeout"));
- });
+ const response = await safeOutboundFetch(rawUrl, {
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
});
+ if (!response.ok) throw new Error(`Proxy fetch failed: ${response.status}`);
+ const text = await readResponseTextLimited(response, MAX_RESPONSE_BYTES);
+ try {
+ return JSON.parse(text);
+ } catch {
+ throw new Error("Response is not valid JSON");
+ }
}
/**
@@ -109,7 +60,9 @@ async function fetchJson(rawUrl: string): Promise {
*/
homepageProxyRouter.get("/", async (req: Request, res: Response) => {
const targetUrl = req.query.url as string;
- const ttl = Math.max(10, Number(req.query.ttl) || 60) * 1000;
+ const ttl =
+ Math.min(MAX_CACHE_TTL_SECONDS, Math.max(10, Number(req.query.ttl) || 60)) *
+ 1000;
if (!targetUrl) return res.status(400).json({ error: "url is required" });
try {
diff --git a/src/backend/database/routes/homepage-rss-routes.ts b/src/backend/database/routes/homepage-rss-routes.ts
index e42cd51b4..b88e45085 100644
--- a/src/backend/database/routes/homepage-rss-routes.ts
+++ b/src/backend/database/routes/homepage-rss-routes.ts
@@ -1,6 +1,9 @@
import express, { type Request, type Response } from "express";
import { homepageLogger } from "../../utils/logger.js";
-import { safeOutboundFetch } from "../../utils/safe-outbound-fetch.js";
+import {
+ readResponseTextLimited,
+ safeOutboundFetch,
+} from "../../utils/safe-outbound-fetch.js";
export const homepageRssRouter = express.Router();
@@ -8,6 +11,7 @@ const rssCache = new Map();
const CACHE_TTL_MS = 1000 * 60 * 15; // 15 minutes
const CACHE_SIZE = 50;
const FETCH_TIMEOUT_MS = 8000;
+const MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
interface RssItem {
title: string;
@@ -21,7 +25,7 @@ function fetchXml(url: string): Promise {
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
}).then(async (res) => {
if (!res.ok) throw new Error(`RSS fetch failed: ${res.status}`);
- return res.text();
+ return readResponseTextLimited(res, MAX_RESPONSE_BYTES);
});
}
@@ -131,7 +135,7 @@ homepageRssRouter.get("/", async (req: Request, res: Response) => {
rssCache.set(feedUrl, { data: items, expires: Date.now() + CACHE_TTL_MS });
res.json(items.slice(0, max));
- } catch (err) {
+ } catch {
homepageLogger.warn("Failed to fetch RSS feed", { feedUrl });
res.status(500).json({ error: "Failed to fetch feed" });
}
diff --git a/src/backend/database/routes/host-autostart-routes.ts b/src/backend/database/routes/host-autostart-routes.ts
index 7c72d8d87..198913c20 100644
--- a/src/backend/database/routes/host-autostart-routes.ts
+++ b/src/backend/database/routes/host-autostart-routes.ts
@@ -7,12 +7,19 @@ import { createCurrentHostRepository } from "../repositories/factory.js";
type HostAutostartRoutesDeps = {
authenticateJWT: RequestHandler;
+ requireViewPermission: RequestHandler;
+ requireEditPermission: RequestHandler;
requireDataAccess: RequestHandler;
};
export function registerHostAutostartRoutes(
router: Router,
- { authenticateJWT, requireDataAccess }: HostAutostartRoutesDeps,
+ {
+ authenticateJWT,
+ requireViewPermission,
+ requireEditPermission,
+ requireDataAccess,
+ }: HostAutostartRoutesDeps,
): void {
/**
* @openapi
@@ -44,6 +51,7 @@ export function registerHostAutostartRoutes(
router.post(
"/autostart/enable",
authenticateJWT,
+ requireEditPermission,
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -204,6 +212,8 @@ export function registerHostAutostartRoutes(
router.delete(
"/autostart/disable",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { sshConfigId } = req.body;
@@ -259,6 +269,8 @@ export function registerHostAutostartRoutes(
router.get(
"/autostart/status",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
diff --git a/src/backend/database/routes/host-bulk-routes.ts b/src/backend/database/routes/host-bulk-routes.ts
index a575dae0e..0bf2f750a 100644
--- a/src/backend/database/routes/host-bulk-routes.ts
+++ b/src/backend/database/routes/host-bulk-routes.ts
@@ -1,3 +1,7 @@
+import {
+ prepareHostImports,
+ remapImportedJumpHosts,
+} from "./host-import-order.js";
import { getErrorMessage } from "../../utils/error-message.js";
import type { AuthenticatedRequest } from "../../../types/index.js";
import type { Request, RequestHandler, Response, Router } from "express";
@@ -8,6 +12,7 @@ import {
createCurrentHostResolutionRepository,
} from "../repositories/factory.js";
import { validateParentHostId } from "./host-parent-validation.js";
+import { serializeWebUiConfig } from "./host-web-endpoints.js";
import {
isNonEmptyString,
isValidPort,
@@ -105,9 +110,22 @@ export function parseSSHConfig(content: string): SSHConfigHost[] {
return results;
}
+export function importedHostUsername(
+ connectionType: string,
+ authType: unknown,
+ username: unknown,
+): string | null {
+ if (isNonEmptyString(username)) return username;
+ if (connectionType !== "ssh" || authType === "credential") return "";
+ return null;
+}
+
export function registerHostBulkRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireCreatePermission: RequestHandler,
+ requireEditPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -172,6 +190,8 @@ export function registerHostBulkRoutes(
router.patch(
"/bulk-update",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostIds, updates } = req.body;
@@ -265,10 +285,16 @@ export function registerHostBulkRoutes(
simpleUpdates.enableFileManager = updates.enableFileManager;
if (typeof updates.enableDocker === "boolean")
simpleUpdates.enableDocker = updates.enableDocker;
+ if (typeof updates.enableWebUi === "boolean") {
+ simpleUpdates.enableWebUi = updates.enableWebUi;
+ if (!updates.enableWebUi) simpleUpdates.webUiConfig = null;
+ }
if (typeof updates.enableTmuxMonitor === "boolean")
simpleUpdates.enableTmuxMonitor = updates.enableTmuxMonitor;
if (typeof updates.enableTerminalToolbar === "boolean")
simpleUpdates.enableTerminalToolbar = updates.enableTerminalToolbar;
+ if (typeof updates.enableAiAssistant === "boolean")
+ simpleUpdates.enableAiAssistant = updates.enableAiAssistant;
// Disabling Proxmox is a plain flag flip; enabling is handled per-host
// below so each host can default to its own stored credential.
if (updates.enableProxmox === false)
@@ -376,6 +402,8 @@ export function registerHostBulkRoutes(
router.put(
"/reorder",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { positions } = req.body as {
@@ -422,6 +450,9 @@ export function registerHostBulkRoutes(
router.post(
"/bulk-import",
authenticateJWT,
+ requireCreatePermission,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const {
@@ -442,6 +473,14 @@ export function registerHostBulkRoutes(
.json({ error: "Maximum 100 hosts allowed per import" });
}
+ let orderedHosts: ReturnType;
+ try {
+ orderedHosts = prepareHostImports(hostsToImport);
+ } catch (error) {
+ return res.status(400).json({ error: getErrorMessage(error) });
+ }
+ const importedIds = new Map();
+
const results = {
success: 0,
updated: 0,
@@ -533,9 +572,7 @@ export function registerHostBulkRoutes(
}
}
- for (let i = 0; i < hostsToImport.length; i++) {
- const hostData = normalizeImportedHost(hostsToImport[i]);
-
+ for (const { host: hostData, index: i, exportId } of orderedHosts) {
try {
const effectiveConnectionType = hostData.connectionType || "ssh";
@@ -558,10 +595,12 @@ export function registerHostBulkRoutes(
continue;
}
- if (
- effectiveConnectionType === "ssh" &&
- !isNonEmptyString(hostData.username)
- ) {
+ const username = importedHostUsername(
+ effectiveConnectionType,
+ hostData.authType,
+ hostData.username,
+ );
+ if (username === null) {
results.failed++;
results.errors.push(
`Host ${i + 1}: Username required for SSH connections`,
@@ -578,13 +617,14 @@ export function registerHostBulkRoutes(
"credential",
"none",
"opkssh",
+ "stepca",
"tailscale",
"vault",
].includes(hostData.authType)
) {
results.failed++;
results.errors.push(
- `Host ${i + 1}: Invalid authType. Must be 'password', 'key', 'credential', 'none', 'opkssh', 'tailscale', or 'vault'`,
+ `Host ${i + 1}: Invalid authType. Must be 'password', 'key', 'credential', 'none', 'opkssh', 'stepca', 'tailscale', or 'vault'`,
);
continue;
}
@@ -657,23 +697,30 @@ export function registerHostBulkRoutes(
}
}
+ const jumpHosts = remapImportedJumpHosts(
+ hostData.jumpHosts,
+ importedIds,
+ );
const sshDataObj: Record = {
userId: userId,
connectionType: effectiveConnectionType,
- name: hostData.name || `${hostData.username || ""}@${hostData.ip}`,
+ name: hostData.name || `${username}@${hostData.ip}`,
folder: hostData.folder || "Default",
tags: Array.isArray(hostData.tags) ? hostData.tags.join(",") : "",
ip: hostData.ip,
port: hostData.port,
- username: hostData.username || null,
+ username,
pin: hostData.pin || false,
enableTerminal: hostData.enableTerminal !== false,
enableTunnel: hostData.enableTunnel !== false,
enableFileManager: hostData.enableFileManager !== false,
enableDocker: hostData.enableDocker || false,
+ enableWebUi: hostData.enableWebUi || false,
enableProxmox: hostData.enableProxmox || false,
enableTmuxMonitor: hostData.enableTmuxMonitor || false,
enableTerminalToolbar: hostData.enableTerminalToolbar !== false,
+ enableAiAssistant: hostData.enableAiAssistant || false,
+ enableCommandHistory: hostData.enableCommandHistory !== false,
showTerminalInSidebar: hostData.showTerminalInSidebar ? 1 : 0,
showFileManagerInSidebar: hostData.showFileManagerInSidebar ? 1 : 0,
showTunnelInSidebar: hostData.showTunnelInSidebar ? 1 : 0,
@@ -684,9 +731,7 @@ export function registerHostBulkRoutes(
tunnelConnections: hostData.tunnelConnections
? JSON.stringify(hostData.tunnelConnections)
: "[]",
- jumpHosts: hostData.jumpHosts
- ? JSON.stringify(hostData.jumpHosts)
- : null,
+ jumpHosts: jumpHosts ? JSON.stringify(jumpHosts) : null,
quickActions: hostData.quickActions
? JSON.stringify(hostData.quickActions)
: null,
@@ -696,6 +741,9 @@ export function registerHostBulkRoutes(
dockerConfig: hostData.dockerConfig
? JSON.stringify(hostData.dockerConfig)
: null,
+ webUiConfig: hostData.enableWebUi
+ ? serializeWebUiConfig(hostData.webUiConfig)
+ : null,
proxmoxConfig: hostData.proxmoxConfig
? JSON.stringify(hostData.proxmoxConfig)
: null,
@@ -773,15 +821,21 @@ export function registerHostBulkRoutes(
const existing = existingHostMap?.get(lookupKey);
if (existing) {
- await hostRepository.updateEncryptedForUser(
+ const saved = await hostRepository.updateEncryptedForUser(
userId,
existing.id,
sshDataObj,
);
+ if (!saved) throw new Error("Host no longer exists");
+ if (exportId !== undefined) importedIds.set(exportId, existing.id);
results.updated++;
} else {
sshDataObj.createdAt = new Date().toISOString();
- await hostRepository.createEncryptedForUser(userId, sshDataObj);
+ const saved = await hostRepository.createEncryptedForUser(
+ userId,
+ sshDataObj,
+ );
+ if (exportId !== undefined) importedIds.set(exportId, saved.id);
results.success++;
}
} catch (error) {
@@ -832,6 +886,9 @@ export function registerHostBulkRoutes(
router.post(
"/ssh-config-import",
authenticateJWT,
+ requireCreatePermission,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { content, overwrite } = req.body;
@@ -938,9 +995,11 @@ export function registerHostBulkRoutes(
enableTunnel: true,
enableFileManager: true,
enableDocker: false,
+ enableWebUi: false,
enableProxmox: false,
enableTmuxMonitor: false,
enableTerminalToolbar: true,
+ enableAiAssistant: false,
showTerminalInSidebar: 0,
showFileManagerInSidebar: 0,
showTunnelInSidebar: 0,
@@ -955,6 +1014,7 @@ export function registerHostBulkRoutes(
quickActions: null,
statsConfig: null,
dockerConfig: null,
+ webUiConfig: null,
proxmoxConfig: null,
terminalConfig: null,
forceKeyboardInteractive: "false",
diff --git a/src/backend/database/routes/host-command-history-routes.ts b/src/backend/database/routes/host-command-history-routes.ts
index 0f7040445..5658e6f66 100644
--- a/src/backend/database/routes/host-command-history-routes.ts
+++ b/src/backend/database/routes/host-command-history-routes.ts
@@ -7,6 +7,8 @@ import { isNonEmptyString } from "./host-normalizers.js";
export function registerHostCommandHistoryRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireViewPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -33,6 +35,8 @@ export function registerHostCommandHistoryRoutes(
router.get(
"/command-history/:hostId",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const hostIdParam = Array.isArray(req.params.hostId)
@@ -98,6 +102,8 @@ export function registerHostCommandHistoryRoutes(
router.delete(
"/command-history",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, command } = req.body;
diff --git a/src/backend/database/routes/host-file-manager-bookmark-routes.ts b/src/backend/database/routes/host-file-manager-bookmark-routes.ts
index a56f299ce..d8d470315 100644
--- a/src/backend/database/routes/host-file-manager-bookmark-routes.ts
+++ b/src/backend/database/routes/host-file-manager-bookmark-routes.ts
@@ -7,6 +7,8 @@ import { isNonEmptyString } from "./host-normalizers.js";
export function registerHostFileManagerBookmarkRoutes(
router: Router,
authenticateJWT: RequestHandler,
+ requireViewPermission: RequestHandler,
+ requireDataAccess: RequestHandler,
): void {
/**
* @openapi
@@ -33,6 +35,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.get(
"/file_manager/recent",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const hostIdQuery = Array.isArray(req.query.hostId)
@@ -98,6 +102,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.post(
"/file_manager/recent",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path, name } = req.body;
@@ -155,6 +161,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.delete(
"/file_manager/recent",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path } = req.body;
@@ -203,6 +211,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.get(
"/file_manager/pinned",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const hostIdQuery = Array.isArray(req.query.hostId)
@@ -269,6 +279,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.post(
"/file_manager/pinned",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path, name } = req.body;
@@ -327,6 +339,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.delete(
"/file_manager/pinned",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path } = req.body;
@@ -375,6 +389,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.get(
"/file_manager/shortcuts",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const hostIdQuery = Array.isArray(req.query.hostId)
@@ -441,6 +457,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.post(
"/file_manager/shortcuts",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path, name } = req.body;
@@ -499,6 +517,8 @@ export function registerHostFileManagerBookmarkRoutes(
router.delete(
"/file_manager/shortcuts",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { hostId, path } = req.body;
diff --git a/src/backend/database/routes/host-folder-routes.ts b/src/backend/database/routes/host-folder-routes.ts
index 0c11c475e..473291d01 100644
--- a/src/backend/database/routes/host-folder-routes.ts
+++ b/src/backend/database/routes/host-folder-routes.ts
@@ -6,6 +6,7 @@ import {
createCurrentCredentialRepository,
createCurrentFileManagerBookmarkRepository,
createCurrentHostFolderRepository,
+ createCurrentFolderAccessRepository,
createCurrentRecentActivityRepository,
createCurrentRbacAccessRepository,
createCurrentSshCredentialUsageRepository,
@@ -17,12 +18,25 @@ import { isNonEmptyString } from "./host-normalizers.js";
type HostFolderRoutesDeps = {
authenticateJWT: RequestHandler;
+ requireViewPermission: RequestHandler;
+ requireEditPermission: RequestHandler;
+ requireDeletePermission: RequestHandler;
+ requireCredentialEditPermission: RequestHandler;
+ requireDataAccess: RequestHandler;
statsServerUrl: string;
};
export function registerHostFolderRoutes(
router: Router,
- { authenticateJWT, statsServerUrl }: HostFolderRoutesDeps,
+ {
+ authenticateJWT,
+ requireViewPermission,
+ requireEditPermission,
+ requireDeletePermission,
+ requireCredentialEditPermission,
+ requireDataAccess,
+ statsServerUrl,
+ }: HostFolderRoutesDeps,
): void {
/**
* @openapi
@@ -54,6 +68,9 @@ export function registerHostFolderRoutes(
router.put(
"/folders/rename",
authenticateJWT,
+ requireEditPermission,
+ requireCredentialEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { oldName, newName } = req.body;
@@ -76,6 +93,11 @@ export function registerHostFolderRoutes(
oldName,
newName,
);
+ await createCurrentFolderAccessRepository().renameFolder(
+ userId,
+ oldName,
+ newName,
+ );
res.json({
message: "Folder renamed successfully",
@@ -113,6 +135,8 @@ export function registerHostFolderRoutes(
router.get(
"/folders",
authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -170,6 +194,8 @@ export function registerHostFolderRoutes(
router.put(
"/folders/metadata",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { name, color, icon, credentialId } = req.body;
@@ -275,6 +301,8 @@ export function registerHostFolderRoutes(
router.put(
"/folders/reorder",
authenticateJWT,
+ requireEditPermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { positions } = req.body as {
@@ -346,6 +374,8 @@ export function registerHostFolderRoutes(
router.delete(
"/folders/:name/hosts",
authenticateJWT,
+ requireDeletePermission,
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const folderName = Array.isArray(req.params.name)
diff --git a/src/backend/database/routes/host-import-order.ts b/src/backend/database/routes/host-import-order.ts
new file mode 100644
index 000000000..1c9f2d1dc
--- /dev/null
+++ b/src/backend/database/routes/host-import-order.ts
@@ -0,0 +1,56 @@
+import { normalizeImportedHost } from "./host-normalizers.js";
+
+export function prepareHostImports(input: Record[]) {
+ const hosts = input.map((value, index) => ({
+ host: normalizeImportedHost(value),
+ index,
+ exportId: value.exportId ?? value.id,
+ }));
+ const byId = new Map();
+ for (const entry of hosts) {
+ if (entry.exportId === undefined) continue;
+ if (!Number.isSafeInteger(entry.exportId) || Number(entry.exportId) <= 0)
+ throw new Error(`Host ${entry.index + 1}: invalid exportId`);
+ if (byId.has(entry.exportId))
+ throw new Error(`Duplicate exported host ID: ${entry.exportId}`);
+ byId.set(entry.exportId, entry);
+ }
+ const ordered: typeof hosts = [];
+ const visiting = new Set();
+ const visited = new Set();
+ const visit = (entry: (typeof hosts)[number]) => {
+ if (visited.has(entry.index)) return;
+ if (visiting.has(entry.index))
+ throw new Error("Jump-host dependency cycle in import");
+ visiting.add(entry.index);
+ const jumps = entry.host.jumpHosts ?? [];
+ if (!Array.isArray(jumps))
+ throw new Error(`Host ${entry.index + 1}: jumpHosts must be an array`);
+ for (const jump of jumps) {
+ const dependency = byId.get(jump?.hostId);
+ if (!dependency)
+ throw new Error(
+ `Host ${entry.index + 1}: jump host ${jump?.hostId} is missing from the export. Re-export and include all jump hosts.`,
+ );
+ visit(dependency);
+ }
+ visiting.delete(entry.index);
+ visited.add(entry.index);
+ ordered.push(entry);
+ };
+ hosts.forEach(visit);
+ return ordered;
+}
+
+export function remapImportedJumpHosts(
+ jumps: unknown,
+ importedIds: Map,
+) {
+ if (!Array.isArray(jumps)) return null;
+ return jumps.map((jump) => {
+ const hostId = importedIds.get(jump.hostId);
+ if (hostId === undefined)
+ throw new Error(`Jump host ${jump.hostId} failed to import`);
+ return { hostId };
+ });
+}
diff --git a/src/backend/database/routes/host-network-routes.ts b/src/backend/database/routes/host-network-routes.ts
index 257ecdfb1..dce7cd3e8 100644
--- a/src/backend/database/routes/host-network-routes.ts
+++ b/src/backend/database/routes/host-network-routes.ts
@@ -7,12 +7,17 @@ import { createCurrentHostResolutionRepository } from "../repositories/factory.j
interface HostNetworkRoutesDeps {
authenticateJWT: RequestHandler;
+ requireViewPermission: RequestHandler;
requireDataAccess: RequestHandler;
}
export function registerHostNetworkRoutes(
router: Router,
- { authenticateJWT, requireDataAccess }: HostNetworkRoutesDeps,
+ {
+ authenticateJWT,
+ requireViewPermission,
+ requireDataAccess,
+ }: HostNetworkRoutesDeps,
): void {
/**
* @openapi
@@ -62,6 +67,7 @@ export function registerHostNetworkRoutes(
router.post(
"/db/proxy/test",
authenticateJWT,
+ requireViewPermission,
requireDataAccess,
async (req: AuthenticatedRequest, res: Response) => {
try {
@@ -93,6 +99,7 @@ export function registerHostNetworkRoutes(
router.post(
"/db/host/:id/wake",
authenticateJWT,
+ requireViewPermission,
requireDataAccess,
async (req: Request, res: Response) => {
const hostId = Number.parseInt(String(req.params.id), 10);
diff --git a/src/backend/database/routes/host-normalizers.ts b/src/backend/database/routes/host-normalizers.ts
index 510198ad3..3562b579e 100644
--- a/src/backend/database/routes/host-normalizers.ts
+++ b/src/backend/database/routes/host-normalizers.ts
@@ -1,4 +1,5 @@
import type { AuthOverrideProtocol } from "../../../types/auth-protocols.js";
+import { parseWebUiConfig } from "./host-web-endpoints.js";
export function isNonEmptyString(value: unknown): value is string {
return typeof value === "string" && value.trim().length > 0;
@@ -14,6 +15,34 @@ export function isOptionalBoolean(
return value === undefined || typeof value === "boolean";
}
+export function applyHostKeyTypeUpdate(
+ target: Record,
+ keyType: unknown,
+): void {
+ if (keyType !== undefined) {
+ target.keyType = keyType || null;
+ }
+}
+
+const PROTOCOL_ENABLE_FIELDS = [
+ "enableSsh",
+ "enableRdp",
+ "enableVnc",
+ "enableTelnet",
+] as const;
+
+export function normalizeProtocolEnableFields(
+ values: Record,
+): Partial> {
+ return Object.fromEntries(
+ PROTOCOL_ENABLE_FIELDS.flatMap((field) =>
+ typeof values[field] === "boolean"
+ ? [[field, values[field] ? 1 : 0]]
+ : [],
+ ),
+ );
+}
+
export const OWNER_PRIVATE_AUTH_FIELDS = {
ssh: [
"authType",
@@ -152,9 +181,12 @@ export type NormalizedImportedHost = Record & {
enableTunnel?: unknown;
enableFileManager?: unknown;
enableDocker?: unknown;
+ enableWebUi?: unknown;
enableProxmox?: unknown;
enableTmuxMonitor?: unknown;
enableTerminalToolbar?: unknown;
+ enableAiAssistant?: unknown;
+ enableCommandHistory?: unknown;
showTerminalInSidebar?: unknown;
showFileManagerInSidebar?: unknown;
showTunnelInSidebar?: unknown;
@@ -167,6 +199,7 @@ export type NormalizedImportedHost = Record & {
quickActions?: unknown;
statsConfig?: unknown;
dockerConfig?: unknown;
+ webUiConfig?: unknown;
proxmoxConfig?: unknown;
enableProxmoxStats?: unknown;
proxmoxStatsConfig?: unknown;
@@ -331,10 +364,13 @@ const CONNECT_LEVEL_FIELDS = new Set([
"enableTunnel",
"enableFileManager",
"enableDocker",
+ "enableWebUi",
+ "webUiConfig",
"enableProxmox",
"enableProxmoxStats",
"enableTmuxMonitor",
"enableTerminalToolbar",
+ "enableAiAssistant",
"showTerminalInSidebar",
"showFileManagerInSidebar",
"showTunnelInSidebar",
@@ -346,6 +382,7 @@ const CONNECT_LEVEL_FIELDS = new Set([
"enableTelnet",
"sshPort",
"rdpPort",
+ "rdpAuthType",
"vncPort",
"telnetPort",
"defaultPath",
@@ -432,10 +469,12 @@ export function transformHostResponse(
enableTunnel: !!host.enableTunnel,
enableFileManager: host.enableFileManager !== false,
enableDocker: !!host.enableDocker,
+ enableWebUi: !!host.enableWebUi,
enableProxmox: !!host.enableProxmox,
enableProxmoxStats: !!host.enableProxmoxStats,
enableTmuxMonitor: !!host.enableTmuxMonitor,
enableTerminalToolbar: host.enableTerminalToolbar !== false,
+ enableAiAssistant: !!host.enableAiAssistant,
showTerminalInSidebar: !!host.showTerminalInSidebar,
showFileManagerInSidebar: !!host.showFileManagerInSidebar,
showTunnelInSidebar: !!host.showTunnelInSidebar,
@@ -484,6 +523,9 @@ export function transformHostResponse(
dockerConfig: host.dockerConfig
? JSON.parse(host.dockerConfig as string)
: undefined,
+ // Guarded, unlike dockerConfig directly above: parseWebUiConfig never
+ // throws, so a half-written config cannot take out the whole host listing.
+ webUiConfig: parseWebUiConfig(host.webUiConfig),
proxmoxConfig: host.proxmoxConfig
? JSON.parse(host.proxmoxConfig as string)
: undefined,
diff --git a/src/backend/database/routes/host-step-ca-routes.ts b/src/backend/database/routes/host-step-ca-routes.ts
new file mode 100644
index 000000000..16e9cf8dc
--- /dev/null
+++ b/src/backend/database/routes/host-step-ca-routes.ts
@@ -0,0 +1,34 @@
+import type { Request, Response, Router } from "express";
+import { escapeHtml } from "./opkssh-html.js";
+
+function resultPage(ok: boolean, message: string): string {
+ return `Termix
+
+${ok ? "Signed in" : "Sign-in failed"}${escapeHtml(message)} `;
+}
+
+/**
+ * The OIDC redirect target for Step CA sign-ins. Unauthenticated on purpose:
+ * the browser that finishes the sign-in may not be the one running Termix,
+ * so the request is matched to its session by the OAuth state.
+ */
+export function registerHostStepCaRoutes(router: Router): void {
+ router.get("/step-ca-callback", async (req: Request, res: Response) => {
+ const { completeStepCaAuth } = await import("../../hosts/step-ca-auth.js");
+ const stringQuery = (name: string): string | undefined => {
+ const value = req.query[name];
+ return typeof value === "string" ? value : undefined;
+ };
+ const result = await completeStepCaAuth({
+ state: stringQuery("state"),
+ code: stringQuery("code"),
+ error: stringQuery("error"),
+ error_description: stringQuery("error_description"),
+ });
+ res
+ .status(result.ok ? 200 : 400)
+ .type("html")
+ .send(resultPage(result.ok, result.message));
+ });
+}
diff --git a/src/backend/database/routes/host-web-endpoints.ts b/src/backend/database/routes/host-web-endpoints.ts
new file mode 100644
index 000000000..809430ad7
--- /dev/null
+++ b/src/backend/database/routes/host-web-endpoints.ts
@@ -0,0 +1,201 @@
+import {
+ MAX_WEB_ENDPOINTS,
+ MAX_WEB_ENDPOINT_LABEL_LENGTH,
+} from "../../../types/index.js";
+import type { WebEndpoint, WebUiConfig } from "../../../types/index.js";
+
+export { MAX_WEB_ENDPOINTS, MAX_WEB_ENDPOINT_LABEL_LENGTH };
+
+const SCHEMES = new Set(["http", "https"]);
+const ACCESS_VALUES = new Set(["direct", "tunnel"]);
+const RENDER_VALUES = new Set(["external", "embedded"]);
+
+const MIN_PORT = 1;
+const MAX_PORT = 65535;
+
+function isValidPort(value: unknown): value is number {
+ return (
+ typeof value === "number" &&
+ Number.isInteger(value) &&
+ value >= MIN_PORT &&
+ value <= MAX_PORT
+ );
+}
+
+/**
+ * C0 controls and DEL. Checked by codepoint rather than by regex character
+ * class so no escaping subtlety can let one through: a path like
+ * "\t//evil.example" defeats a naive startsWith("//") guard, because the
+ * browser strips the control character and then follows the authority.
+ */
+function hasControlCharacter(value: string): boolean {
+ for (let index = 0; index < value.length; index += 1) {
+ const code = value.charCodeAt(index);
+ if (code <= 0x1f || code === 0x7f) return true;
+ }
+ return false;
+}
+
+/**
+ * Coerces a path to begin with "/", or returns null to drop the endpoint.
+ *
+ * This is THE enforcement point for a value that reaches an href and an
+ * iframe src -- the editor's checks are UX. Anything that could redirect the
+ * frame away from the endpoint is rejected rather than sanitized, because
+ * sanitizing invites a second, subtly different implementation elsewhere.
+ */
+function normalizePath(raw: unknown): string | null {
+ if (raw === undefined || raw === null || raw === "") return "/";
+ if (typeof raw !== "string") return null;
+ if (hasControlCharacter(raw)) return null;
+
+ const path = raw.startsWith("/") ? raw : `/${raw}`;
+
+ if (path.startsWith("//")) return null;
+ if (/^\/[a-z][a-z0-9+.-]*:/i.test(path)) return null;
+ if (path.includes("\\")) return null;
+
+ return path;
+}
+
+/**
+ * A bare host literal, or null to drop the endpoint, or undefined to leave the
+ * field unset (the route then falls back to loopback).
+ *
+ * The value lands both in a TCP listener and in a URL authority, so nothing
+ * carrying a scheme, port, path or credentials may survive.
+ */
+function normalizeBindHost(raw: unknown): string | null | undefined {
+ if (raw === undefined || raw === null || raw === "") return undefined;
+ if (typeof raw !== "string") return null;
+
+ const value = raw.trim();
+ if (!value) return undefined;
+ if (value.length > 253) return null;
+ if (hasControlCharacter(value)) return null;
+
+ const IPV4 = /^\d{1,3}(\.\d{1,3}){3}$/;
+ const HOSTNAME =
+ /^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*$/;
+ const IPV6_BRACKETED = /^\[[0-9A-Fa-f:.]+\]$/;
+
+ if (IPV4.test(value)) {
+ return value.split(".").every((part) => Number(part) <= 255) ? value : null;
+ }
+ if (IPV6_BRACKETED.test(value) || HOSTNAME.test(value)) return value;
+ return null;
+}
+
+function normalizeEndpoint(raw: unknown): WebEndpoint | null {
+ if (!raw || typeof raw !== "object") return null;
+ const input = raw as Record;
+
+ const id = typeof input.id === "string" ? input.id.trim() : "";
+ if (!id) return null;
+
+ const label = typeof input.label === "string" ? input.label.trim() : "";
+ if (!label) return null;
+
+ const scheme = input.scheme;
+ if (typeof scheme !== "string" || !SCHEMES.has(scheme)) return null;
+
+ if (!isValidPort(input.port)) return null;
+
+ const path = normalizePath(input.path);
+ if (path === null) return null;
+
+ const access = input.access;
+ if (typeof access !== "string" || !ACCESS_VALUES.has(access)) return null;
+
+ const render = input.render;
+ if (typeof render !== "string" || !RENDER_VALUES.has(render)) return null;
+
+ const isTunnel = access === "tunnel";
+
+ const endpoint: WebEndpoint = {
+ id,
+ label: label.slice(0, MAX_WEB_ENDPOINT_LABEL_LENGTH),
+ scheme: scheme as WebEndpoint["scheme"],
+ port: input.port,
+ path,
+ access: access as WebEndpoint["access"],
+ render: render as WebEndpoint["render"],
+ // Meaningless for a tunnel, whose host component is loopback and already
+ // exempt from certificate checks. Cleared rather than carried so nothing
+ // downstream has to re-derive that.
+ ignoreCert: !isTunnel && input.ignoreCert === true,
+ };
+
+ // Both are tunnel-only. Silently ignored on a direct endpoint rather than
+ // rejected: they describe a forward that a direct endpoint never creates.
+ if (isTunnel) {
+ const bindHost = normalizeBindHost(input.bindHost);
+ if (bindHost === null) return null;
+ if (bindHost !== undefined) endpoint.bindHost = bindHost;
+
+ if (input.localPort !== undefined && input.localPort !== null) {
+ if (!isValidPort(input.localPort)) return null;
+ endpoint.localPort = input.localPort;
+ }
+ }
+
+ return endpoint;
+}
+
+/**
+ * Drops any endpoint it refuses rather than rejecting the whole host -- one
+ * bad row must not make a host unsaveable or unlistable. The editor is
+ * responsible for telling the user before that happens
+ * (src/ui/lib/web-endpoint-validation.ts).
+ */
+export function normalizeWebEndpoints(raw: unknown): WebEndpoint[] {
+ if (!Array.isArray(raw)) return [];
+
+ const seen = new Set();
+ const endpoints: WebEndpoint[] = [];
+
+ for (const candidate of raw) {
+ if (endpoints.length >= MAX_WEB_ENDPOINTS) break;
+ const endpoint = normalizeEndpoint(candidate);
+ if (!endpoint) continue;
+ if (seen.has(endpoint.id)) continue;
+ seen.add(endpoint.id);
+ endpoints.push(endpoint);
+ }
+
+ return endpoints;
+}
+
+/**
+ * Never throws. A malformed stored value yields an empty endpoint list, so a
+ * half-written config cannot take out the whole host listing -- which is what
+ * dockerConfig's bare JSON.parse does today.
+ */
+export function parseWebUiConfig(raw: unknown): WebUiConfig {
+ if (raw === undefined || raw === null) return { endpoints: [] };
+
+ let value: unknown = raw;
+ if (typeof raw === "string") {
+ try {
+ value = JSON.parse(raw);
+ } catch {
+ return { endpoints: [] };
+ }
+ }
+
+ if (!value || typeof value !== "object") return { endpoints: [] };
+ return {
+ endpoints: normalizeWebEndpoints(
+ (value as { endpoints?: unknown }).endpoints,
+ ),
+ };
+}
+
+/** Null when nothing survives normalization, so the column is cleared. */
+export function serializeWebUiConfig(config: unknown): string | null {
+ const endpoints = normalizeWebEndpoints(
+ (config as { endpoints?: unknown } | null | undefined)?.endpoints,
+ );
+ if (endpoints.length === 0) return null;
+ return JSON.stringify({ endpoints });
+}
diff --git a/src/backend/database/routes/host.ts b/src/backend/database/routes/host.ts
index 7983db2d7..78db52079 100644
--- a/src/backend/database/routes/host.ts
+++ b/src/backend/database/routes/host.ts
@@ -1,4 +1,6 @@
import { getErrorMessage } from "../../utils/error-message.js";
+import { applyFolderAccessRules } from "../../utils/folder-access-inheritance.js";
+import { findUsableCredential } from "../../hosts/usable-credential.js";
import type { AuthenticatedRequest } from "../../../types/index.js";
import express, { type Request, type Response } from "express";
import axios from "axios";
@@ -12,7 +14,7 @@ import {
pickResolvedPassword,
pickResolvedUsername,
} from "../../hosts/credential-username.js";
-import { notifyAutomationInternalEvent } from "../../hosts/metrics/automation-bridge.js";
+import { notifyAutomationInternalEvent } from "../../hosts/automation-events.js";
import {
createCurrentCommandHistoryRepository,
createCurrentCredentialRepository,
@@ -28,12 +30,15 @@ import {
createCurrentHostRepository,
createCurrentUserRepository,
createCurrentSyncTombstoneRepository,
+ createCurrentSharedHostAuthOverrideRepository,
} from "../repositories/factory.js";
import {
+ applyHostKeyTypeUpdate,
containsOwnerPrivateAuthUpdate,
isNonEmptyString,
isOptionalBoolean,
isValidPort,
+ normalizeProtocolEnableFields,
OWNER_PRIVATE_AUTH_FIELDS,
OWNER_PRIVATE_TERMINAL_CONFIG_FIELDS,
sanitizeHostForRecipient,
@@ -42,6 +47,7 @@ import {
} from "./host-normalizers.js";
import { validateParentHostId } from "./host-parent-validation.js";
import { registerHostOpksshRoutes } from "./host-opkssh-routes.js";
+import { registerHostStepCaRoutes } from "./host-step-ca-routes.js";
import { registerHostFolderRoutes } from "./host-folder-routes.js";
import { registerHostFileManagerBookmarkRoutes } from "./host-file-manager-bookmark-routes.js";
import { registerHostCommandHistoryRoutes } from "./host-command-history-routes.js";
@@ -62,6 +68,11 @@ import type {
HostResolutionCredentialRecord,
HostResolutionHostRecord,
} from "../repositories/host-resolution-repository.js";
+import { AUTH_PROTOCOL_METADATA } from "../../../types/auth-protocols.js";
+import {
+ parseWebUiConfig,
+ serializeWebUiConfig,
+} from "./host-web-endpoints.js";
import {
requiresPersonalHostAuthentication,
resolveRecipientSharedHostAuthentication,
@@ -125,6 +136,7 @@ registerHostInternalRoutes(router);
router.post(
["/db/host", "/enroll"],
authenticateJWT,
+ permissionManager.requirePermission("hosts.create"),
requireDataAccess,
requireHostEnrollmentAccessForPath,
upload.single("key"),
@@ -190,9 +202,11 @@ router.post(
enableFileManager,
scpLegacy,
enableDocker,
+ enableWebUi,
enableProxmox,
enableTmuxMonitor,
enableTerminalToolbar,
+ enableAiAssistant,
allowSessionSharing,
showTerminalInSidebar,
showFileManagerInSidebar,
@@ -205,6 +219,7 @@ router.post(
quickActions,
statsConfig,
dockerConfig,
+ webUiConfig,
proxmoxConfig,
enableProxmoxStats,
proxmoxStatsConfig,
@@ -261,7 +276,8 @@ router.post(
!isNonEmptyString(userId) ||
!isNonEmptyString(ip) ||
!isValidPort(port) ||
- !isOptionalBoolean(shareSshAuth)
+ !isOptionalBoolean(shareSshAuth) ||
+ ![enableSsh, enableRdp, enableVnc, enableTelnet].every(isOptionalBoolean)
) {
sshLogger.warn("Invalid SSH data input validation failed", {
operation: "host_create",
@@ -332,9 +348,11 @@ router.post(
enableFileManager: enableFileManager ? 1 : 0,
scpLegacy: scpLegacy ? 1 : 0,
enableDocker: enableDocker ? 1 : 0,
+ enableWebUi: enableWebUi ? 1 : 0,
enableProxmox: enableProxmox ? 1 : 0,
enableTmuxMonitor: enableTmuxMonitor ? 1 : 0,
enableTerminalToolbar: enableTerminalToolbar === false ? 0 : 1,
+ enableAiAssistant: enableAiAssistant ? 1 : 0,
allowSessionSharing: allowSessionSharing === false ? 0 : 1,
showTerminalInSidebar: showTerminalInSidebar ? 1 : 0,
showFileManagerInSidebar: showFileManagerInSidebar ? 1 : 0,
@@ -352,6 +370,13 @@ router.post(
? dockerConfig
: JSON.stringify(dockerConfig)
: null,
+ webUiConfig: enableWebUi
+ ? serializeWebUiConfig(
+ typeof webUiConfig === "string"
+ ? safeParseJson(webUiConfig)
+ : webUiConfig,
+ )
+ : null,
proxmoxConfig: proxmoxConfig
? typeof proxmoxConfig === "string"
? proxmoxConfig
@@ -392,10 +417,7 @@ router.post(
portKnockSequence: portKnockSequence
? JSON.stringify(portKnockSequence)
: null,
- enableSsh: enableSsh ? 1 : 0,
- enableRdp: enableRdp ? 1 : 0,
- enableVnc: enableVnc ? 1 : 0,
- enableTelnet: enableTelnet ? 1 : 0,
+ ...normalizeProtocolEnableFields(hostData),
sshPort: sshPort || port || 22,
rdpPort: rdpPort || 3389,
vncPort: vncPort || 5900,
@@ -498,6 +520,20 @@ router.post(
}
const createdHost = result;
+ // Standing folder shares apply to the newcomer.
+ try {
+ await applyFolderAccessRules(
+ createdHost.id,
+ userId!,
+ createdHost.folder,
+ );
+ } catch (folderAccessError) {
+ sshLogger.warn("Failed to inherit folder access on host create", {
+ operation: "host_create_folder_access",
+ hostId: createdHost.id,
+ error: getErrorMessage(folderAccessError),
+ });
+ }
const baseHost = transformHostResponse(createdHost);
const resolvedHost =
@@ -712,11 +748,7 @@ router.post(
let resolvedUsername = username;
if (authType === "credential" && credentialId) {
- const cred =
- await createCurrentHostResolutionRepository().findCredentialByIdForUser(
- Number(credentialId),
- userId,
- );
+ const cred = await findUsableCredential(Number(credentialId), userId);
if (!cred) {
return res.status(404).json({ error: "Credential not found" });
@@ -753,10 +785,12 @@ router.post(
enableTunnel: false,
enableFileManager: true,
enableDocker: false,
+ enableWebUi: false,
enableProxmox: false,
enableProxmoxStats: false,
enableTmuxMonitor: false,
enableTerminalToolbar: true,
+ enableAiAssistant: false,
showTerminalInSidebar: true,
showFileManagerInSidebar: false,
showTunnelInSidebar: false,
@@ -817,6 +851,7 @@ router.post(
router.put(
"/db/host/:id",
authenticateJWT,
+ permissionManager.requirePermission("hosts.edit"),
requireDataAccess,
upload.single("key"),
async (req: Request, res: Response) => {
@@ -882,9 +917,11 @@ router.put(
enableFileManager,
scpLegacy,
enableDocker,
+ enableWebUi,
enableProxmox,
enableTmuxMonitor,
enableTerminalToolbar,
+ enableAiAssistant,
allowSessionSharing,
showTerminalInSidebar,
showFileManagerInSidebar,
@@ -897,6 +934,7 @@ router.put(
quickActions,
statsConfig,
dockerConfig,
+ webUiConfig,
proxmoxConfig,
enableProxmoxStats,
proxmoxStatsConfig,
@@ -954,6 +992,9 @@ router.put(
!isNonEmptyString(ip) ||
!isValidPort(port) ||
!isOptionalBoolean(shareSshAuth) ||
+ ![enableSsh, enableRdp, enableVnc, enableTelnet].every(
+ isOptionalBoolean,
+ ) ||
!hostId
) {
sshLogger.warn("Invalid SSH data input validation failed for update", {
@@ -1025,9 +1066,11 @@ router.put(
enableFileManager: enableFileManager ? 1 : 0,
scpLegacy: scpLegacy ? 1 : 0,
enableDocker: enableDocker ? 1 : 0,
+ enableWebUi: enableWebUi ? 1 : 0,
enableProxmox: enableProxmox ? 1 : 0,
enableTmuxMonitor: enableTmuxMonitor ? 1 : 0,
enableTerminalToolbar: enableTerminalToolbar === false ? 0 : 1,
+ enableAiAssistant: enableAiAssistant ? 1 : 0,
allowSessionSharing: allowSessionSharing === false ? 0 : 1,
showTerminalInSidebar: showTerminalInSidebar ? 1 : 0,
showFileManagerInSidebar: showFileManagerInSidebar ? 1 : 0,
@@ -1045,6 +1088,13 @@ router.put(
? dockerConfig
: JSON.stringify(dockerConfig)
: null,
+ webUiConfig: enableWebUi
+ ? serializeWebUiConfig(
+ typeof webUiConfig === "string"
+ ? safeParseJson(webUiConfig)
+ : webUiConfig,
+ )
+ : null,
proxmoxConfig: proxmoxConfig
? typeof proxmoxConfig === "string"
? proxmoxConfig
@@ -1085,10 +1135,7 @@ router.put(
portKnockSequence: portKnockSequence
? JSON.stringify(portKnockSequence)
: null,
- enableSsh: enableSsh ? 1 : 0,
- enableRdp: enableRdp ? 1 : 0,
- enableVnc: enableVnc ? 1 : 0,
- enableTelnet: enableTelnet ? 1 : 0,
+ ...normalizeProtocolEnableFields(hostData),
sshPort: sshPort || port || 22,
rdpPort: rdpPort || 3389,
vncPort: vncPort || 5900,
@@ -1157,9 +1204,7 @@ router.put(
if (keyPassword !== undefined) {
sshDataObj.keyPassword = keyPassword || null;
}
- if (keyType) {
- sshDataObj.keyType = keyType;
- }
+ applyHostKeyTypeUpdate(sshDataObj, keyType);
sshDataObj.password = password || null;
} else if (effectiveAuthType === "credential") {
sshDataObj.password = password || null;
@@ -1370,6 +1415,21 @@ router.put(
sshDataObj,
);
+ // A host that moved into a folder inherits that folder's standing shares.
+ try {
+ await applyFolderAccessRules(
+ Number(hostId),
+ ownerId,
+ sshDataObj.folder as string | null | undefined,
+ );
+ } catch (folderAccessError) {
+ sshLogger.warn("Failed to inherit folder access on host update", {
+ operation: "host_update_folder_access",
+ hostId: parseInt(hostId),
+ error: getErrorMessage(folderAccessError),
+ });
+ }
+
// Keep every recipient's re-encrypted secret snapshots in sync with
// the updated host record.
try {
@@ -1455,9 +1515,94 @@ router.put(
* 500:
* description: Failed to fetch SSH data.
*/
+/**
+ * @openapi
+ * /host/db/host/{id}/terminal-config:
+ * patch:
+ * summary: Update a host's terminal behaviour flags
+ * description: Merges the given flags into the host's terminalConfig. Owner or a recipient with edit access. Currently supports autoTmux; used by the "enable Auto-Tmux" action shown when a persisted session expires.
+ * tags:
+ * - Hosts
+ * requestBody:
+ * required: true
+ * content:
+ * application/json:
+ * schema:
+ * type: object
+ * properties:
+ * autoTmux:
+ * type: boolean
+ * responses:
+ * 200:
+ * description: Updated.
+ * 403:
+ * description: No edit access.
+ * 404:
+ * description: Host not found.
+ */
+router.patch(
+ "/db/host/:id/terminal-config",
+ authenticateJWT,
+ permissionManager.requirePermission("hosts.edit"),
+ requireDataAccess,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const hostId = parseInt(String(req.params.id), 10);
+ const { autoTmux } = req.body ?? {};
+
+ if (isNaN(hostId)) {
+ return res.status(400).json({ error: "Invalid host ID" });
+ }
+ if (typeof autoTmux !== "boolean") {
+ return res.status(400).json({ error: "autoTmux must be a boolean" });
+ }
+
+ try {
+ const access = await permissionManager.canAccessHost(
+ userId,
+ hostId,
+ "edit",
+ );
+ if (!access.hasAccess) {
+ return res.status(403).json({ error: "Access denied to host" });
+ }
+ const ownerId =
+ await createCurrentHostResolutionRepository().findHostOwnerId(hostId);
+ const host = ownerId
+ ? await createCurrentHostRepository().findByIdForUser(ownerId, hostId)
+ : null;
+ if (!host || !ownerId) {
+ return res.status(404).json({ error: "Host not found" });
+ }
+
+ let terminalConfig: Record = {};
+ if (host.terminalConfig) {
+ try {
+ terminalConfig = JSON.parse(host.terminalConfig);
+ } catch {
+ terminalConfig = {};
+ }
+ }
+ await createCurrentHostRepository().updateForUser(ownerId, hostId, {
+ terminalConfig: JSON.stringify({ ...terminalConfig, autoTmux }),
+ });
+
+ res.json({ success: true, autoTmux });
+ } catch (error) {
+ sshLogger.error("Failed to update host terminal config", error, {
+ operation: "host_terminal_config_update",
+ hostId,
+ userId,
+ });
+ res.status(500).json({ error: "Failed to update terminal config" });
+ }
+ },
+);
+
router.get(
"/db/host",
authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -1601,6 +1746,7 @@ router.get(
router.get(
"/db/host/:id",
authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const hostId = Array.isArray(req.params.id)
@@ -1695,6 +1841,78 @@ router.get(
},
);
+/**
+ * Returns the minimum authentication material needed by the desktop app to
+ * connect to a shared host from the recipient's own network. The response is
+ * deliberately transient: callers must not persist it or include it in logs.
+ */
+router.get(
+ "/db/host/:id/local-connection-auth",
+ authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
+ async (req: Request, res: Response) => {
+ const hostId = Number(req.params.id);
+ const userId = (req as AuthenticatedRequest).userId;
+
+ if (!isNonEmptyString(userId) || !Number.isInteger(hostId) || hostId <= 0) {
+ return res.status(400).json({ error: "Invalid userId or hostId" });
+ }
+
+ try {
+ const access = await permissionManager.canAccessHost(
+ userId,
+ hostId,
+ "connect",
+ );
+ if (!access.hasAccess || !access.isShared) {
+ return res.status(404).json({ error: "Shared host not found" });
+ }
+
+ const repository = createCurrentHostResolutionRepository();
+ const ownerId = await repository.findHostOwnerId(hostId);
+ const host = ownerId
+ ? await repository.findHostById(hostId, ownerId)
+ : null;
+ if (!host) {
+ return res.status(404).json({ error: "Shared host not found" });
+ }
+
+ const resolved = await resolveHostCredentials(
+ {
+ ...transformHostResponse(host),
+ isShared: true,
+ permissionLevel: access.permissionLevel,
+ },
+ userId,
+ );
+
+ res.setHeader("Cache-Control", "no-store");
+ return res.json({
+ username: resolved.username,
+ authType: resolved.authType,
+ password: resolved.password || null,
+ key: resolved.key || null,
+ keyPassword: resolved.keyPassword || null,
+ keyType: resolved.keyType || null,
+ });
+ } catch (error) {
+ sshLogger.error(
+ "Failed to resolve shared host local authentication",
+ error,
+ {
+ operation: "shared_host_local_auth_resolve",
+ hostId,
+ userId,
+ },
+ );
+ return res
+ .status(500)
+ .json({ error: "Failed to resolve shared host authentication" });
+ }
+ },
+);
+
/**
* @openapi
* /host/db/host/{id}/password:
@@ -1843,6 +2061,7 @@ router.get(
);
const baseExportData = {
+ exportId: resolvedHost.id,
connectionType: exportedConnectionType,
name: resolvedHost.name,
ip: resolvedHost.ip,
@@ -1896,14 +2115,17 @@ router.get(
overrideCredentialUsername:
!!resolvedHost.overrideCredentialUsername,
enableTerminal: !!resolvedHost.enableTerminal,
+ enableCommandHistory: resolvedHost.enableCommandHistory !== false,
enableTunnel: !!resolvedHost.enableTunnel,
enableFileManager: resolvedHost.enableFileManager !== false,
scpLegacy: !!resolvedHost.scpLegacy,
enableDocker: !!resolvedHost.enableDocker,
+ enableWebUi: !!resolvedHost.enableWebUi,
enableProxmox: !!resolvedHost.enableProxmox,
enableProxmoxStats: !!resolvedHost.enableProxmoxStats,
enableTmuxMonitor: !!resolvedHost.enableTmuxMonitor,
enableTerminalToolbar: resolvedHost.enableTerminalToolbar !== false,
+ enableAiAssistant: !!resolvedHost.enableAiAssistant,
showTerminalInSidebar: !!resolvedHost.showTerminalInSidebar,
showFileManagerInSidebar: !!resolvedHost.showFileManagerInSidebar,
showTunnelInSidebar: !!resolvedHost.showTunnelInSidebar,
@@ -1923,6 +2145,7 @@ router.get(
statsConfig: resolvedHost.statsConfig
? JSON.parse(resolvedHost.statsConfig as string)
: null,
+ webUiConfig: parseWebUiConfig(resolvedHost.webUiConfig),
dockerConfig: resolvedHost.dockerConfig
? JSON.parse(resolvedHost.dockerConfig as string)
: null,
@@ -2022,6 +2245,7 @@ router.get(
);
const baseExportData = {
+ exportId: resolvedHost.id,
connectionType: exportedConnectionType,
name: resolvedHost.name,
ip: resolvedHost.ip,
@@ -2057,13 +2281,16 @@ router.get(
overrideCredentialUsername:
!!resolvedHost.overrideCredentialUsername,
enableTerminal: !!resolvedHost.enableTerminal,
+ enableCommandHistory: resolvedHost.enableCommandHistory !== false,
enableTunnel: !!resolvedHost.enableTunnel,
enableFileManager: resolvedHost.enableFileManager !== false,
enableDocker: !!resolvedHost.enableDocker,
+ enableWebUi: !!resolvedHost.enableWebUi,
enableProxmox: !!resolvedHost.enableProxmox,
enableTmuxMonitor: !!resolvedHost.enableTmuxMonitor,
enableTerminalToolbar:
resolvedHost.enableTerminalToolbar !== false,
+ enableAiAssistant: !!resolvedHost.enableAiAssistant,
showTerminalInSidebar: !!resolvedHost.showTerminalInSidebar,
showFileManagerInSidebar: !!resolvedHost.showFileManagerInSidebar,
showTunnelInSidebar: !!resolvedHost.showTunnelInSidebar,
@@ -2085,6 +2312,7 @@ router.get(
statsConfig: resolvedHost.statsConfig
? JSON.parse(resolvedHost.statsConfig as string)
: null,
+ webUiConfig: parseWebUiConfig(resolvedHost.webUiConfig),
dockerConfig: resolvedHost.dockerConfig
? JSON.parse(resolvedHost.dockerConfig as string)
: null,
@@ -2223,6 +2451,7 @@ router.get(
router.delete(
"/db/host/:id",
authenticateJWT,
+ permissionManager.requirePermission("hosts.delete"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -2354,11 +2583,18 @@ router.delete(
},
);
-registerHostFileManagerBookmarkRoutes(router, authenticateJWT);
+registerHostFileManagerBookmarkRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
+);
router.get(
"/transfer/recent",
authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const sourceHostIdQuery = Array.isArray(req.query.sourceHostId)
@@ -2395,6 +2631,8 @@ router.get(
router.post(
"/transfer/recent",
authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
const { sourceHostId, destHostId, destPath, destPathLabel } = req.body;
@@ -2426,7 +2664,12 @@ router.post(
}
},
);
-registerHostCommandHistoryRoutes(router, authenticateJWT);
+registerHostCommandHistoryRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
+);
async function resolveHostCredentials(
host: Record,
@@ -2455,6 +2698,24 @@ async function resolveHostCredentials(
required: needsPersonalCredential,
ownerAuthShared: !!host.shareSshAuth,
};
+ // Owner auth for the remote desktop protocols is always snapshotted
+ // for recipients; only their own override credential varies per user.
+ const authOverrides: Record = {
+ ssh: baseSshOverrideState,
+ };
+ const overrideCredentialIds =
+ await createCurrentSharedHostAuthOverrideRepository().listCredentialIds(
+ host.id,
+ requestingUserId,
+ );
+ for (const protocol of ["rdp", "vnc", "telnet"] as const) {
+ if (!host[AUTH_PROTOCOL_METADATA[protocol].enableField]) continue;
+ authOverrides[protocol] = {
+ credentialId: overrideCredentialIds[protocol],
+ required: false,
+ ownerAuthShared: true,
+ };
+ }
const recipientHost: Record = {
...host,
credentialId: null,
@@ -2462,9 +2723,7 @@ async function resolveHostCredentials(
key: null,
keyPassword: null,
keyType: null,
- authOverrides: {
- ssh: baseSshOverrideState,
- },
+ authOverrides,
};
try {
@@ -2480,6 +2739,7 @@ async function resolveHostCredentials(
return {
...recipientHost,
authOverrides: {
+ ...authOverrides,
ssh: {
credentialId: resolution.credentialId,
required: false,
@@ -2505,6 +2765,7 @@ async function resolveHostCredentials(
return {
...recipientHost,
authOverrides: {
+ ...authOverrides,
ssh: {
required: false,
ownerAuthShared: true,
@@ -2524,6 +2785,7 @@ async function resolveHostCredentials(
return {
...recipientHost,
authOverrides: {
+ ...authOverrides,
ssh: {
required: false,
ownerAuthShared: true,
@@ -2547,6 +2809,7 @@ async function resolveHostCredentials(
return {
...recipientHost,
authOverrides: {
+ ...authOverrides,
ssh: {
required: false,
ownerAuthShared: !!host.shareSshAuth,
@@ -2567,10 +2830,7 @@ async function resolveHostCredentials(
const credential =
preloadedCredentials?.get(credentialId) ??
- (await createCurrentHostResolutionRepository().findCredentialByIdForUser(
- credentialId,
- credentialOwnerId,
- ));
+ (await findUsableCredential(credentialId, credentialOwnerId));
if (credential) {
const resolvedHost: Record = {
@@ -2605,13 +2865,27 @@ async function resolveHostCredentials(
registerHostFolderRoutes(router, {
authenticateJWT,
+ requireViewPermission: permissionManager.requirePermission("hosts.view"),
+ requireEditPermission: permissionManager.requirePermission("hosts.edit"),
+ requireDeletePermission: permissionManager.requirePermission("hosts.delete"),
+ requireCredentialEditPermission:
+ permissionManager.requirePermission("credentials.edit"),
+ requireDataAccess,
statsServerUrl: STATS_SERVER_URL,
});
-registerHostBulkRoutes(router, authenticateJWT);
+registerHostBulkRoutes(
+ router,
+ authenticateJWT,
+ permissionManager.requirePermission("hosts.create"),
+ permissionManager.requirePermission("hosts.edit"),
+ requireDataAccess,
+);
registerHostAutostartRoutes(router, {
authenticateJWT,
+ requireViewPermission: permissionManager.requirePermission("hosts.view"),
+ requireEditPermission: permissionManager.requirePermission("hosts.edit"),
requireDataAccess,
});
@@ -2656,6 +2930,8 @@ registerHostAutostartRoutes(router, {
router.get(
"/ssh/opkssh/token/:hostId",
authenticateJWT,
+ permissionManager.requirePermission("hosts.view"),
+ requireDataAccess,
requireDataAccess,
async (req: AuthenticatedRequest, res: Response) => {
const userId = req.userId;
@@ -2727,6 +3003,8 @@ router.get(
router.delete(
"/ssh/opkssh/token/:hostId",
authenticateJWT,
+ permissionManager.requirePermission("hosts.edit"),
+ requireDataAccess,
requireDataAccess,
async (req: AuthenticatedRequest, res: Response) => {
const userId = req.userId;
@@ -2756,10 +3034,26 @@ router.delete(
);
registerHostOpksshRoutes(router);
+registerHostStepCaRoutes(router);
registerHostNetworkRoutes(router, {
authenticateJWT,
+ requireViewPermission: permissionManager.requirePermission("hosts.view"),
requireDataAccess,
});
export default router;
+
+/**
+ * A webUiConfig arriving as a JSON string (an import, or a client that
+ * stringified it) must still reach serializeWebUiConfig as an object.
+ * Malformed input becomes null, which serializes to a cleared column rather
+ * than throwing inside a host save.
+ */
+function safeParseJson(raw: string): unknown {
+ try {
+ return JSON.parse(raw);
+ } catch {
+ return null;
+ }
+}
diff --git a/src/backend/database/routes/keybinding-validation.ts b/src/backend/database/routes/keybinding-validation.ts
index 1890c328e..11911049f 100644
--- a/src/backend/database/routes/keybinding-validation.ts
+++ b/src/backend/database/routes/keybinding-validation.ts
@@ -4,6 +4,9 @@ const VALID_ACTION_TYPES = [
"sendControlCode",
"sendText",
"runSnippet",
+ "nextTab",
+ "previousTab",
+ "openCommandPalette",
];
export function isValidKeyCombo(combo: unknown): boolean {
diff --git a/src/backend/database/routes/opkssh-html.ts b/src/backend/database/routes/opkssh-html.ts
index fa94ac3a3..f865edfd3 100644
--- a/src/backend/database/routes/opkssh-html.ts
+++ b/src/backend/database/routes/opkssh-html.ts
@@ -1,6 +1,6 @@
import { sshLogger } from "../../utils/logger.js";
-function escapeHtml(value: string): string {
+export function escapeHtml(value: string): string {
return value
.replace(/&/g, "&")
.replace(/ Express -> 404) ahead of the plugin
+// loader landing.
+//
+// WebSocket note: plugin WS traffic does NOT get its own port from the
+// 30001-30006 range. It rides the existing WS servers (e.g. the terminal or
+// tunnel WS servers) using a named-channel envelope, the same way other
+// features multiplex over a shared connection. This is a settled decision,
+// not a placeholder, so it should not need revisiting when plugin WS support
+// is implemented.
+
+import express, { type Request, type Response, type Router } from "express";
+import { databaseLogger } from "../../utils/logger.js";
+
+const router = express.Router();
+
+const activePluginRouters = new Map();
+
+/**
+ * @openapi
+ * /plugin-api/{pluginId}/{path}:
+ * get:
+ * summary: Dispatch a request to an installed plugin's backend router
+ * description: >
+ * Forwards the request to the sub-router registered by the plugin with
+ * the given id. Returns 404 if the plugin is not installed or not
+ * currently running. All HTTP methods are dispatched the same way.
+ * tags:
+ * - Plugins
+ * parameters:
+ * - in: path
+ * name: pluginId
+ * required: true
+ * schema:
+ * type: string
+ * responses:
+ * 200:
+ * description: Response from the plugin's router.
+ * 404:
+ * description: Plugin not installed or not running.
+ */
+router.use("/:pluginId", (req: Request, res: Response, next) => {
+ const pluginId = String(req.params.pluginId);
+ const pluginRouter = activePluginRouters.get(pluginId);
+
+ if (!pluginRouter) {
+ databaseLogger.warn("Plugin API request for unregistered plugin", {
+ operation: "plugin_api_dispatch",
+ pluginId,
+ });
+ res.status(404).json({ error: "Plugin not installed or not running" });
+ return;
+ }
+
+ pluginRouter(req, res, next);
+});
+
+export default router;
diff --git a/src/backend/database/routes/proxmox-jump-hosts.ts b/src/backend/database/routes/proxmox-jump-hosts.ts
new file mode 100644
index 000000000..a71453127
--- /dev/null
+++ b/src/backend/database/routes/proxmox-jump-hosts.ts
@@ -0,0 +1,17 @@
+export function parseProxmoxJumpHosts(raw: unknown): unknown[] | null {
+ if (!raw) return null;
+ if (Array.isArray(raw)) return raw;
+ if (typeof raw !== "string") return null;
+
+ try {
+ const parsed = JSON.parse(raw);
+ return Array.isArray(parsed) ? parsed : null;
+ } catch {
+ return null;
+ }
+}
+
+export function serializeProxmoxJumpHosts(raw: unknown): string | null {
+ const parsed = parseProxmoxJumpHosts(raw);
+ return parsed ? JSON.stringify(parsed) : null;
+}
diff --git a/src/backend/database/routes/proxmox.ts b/src/backend/database/routes/proxmox.ts
index 3cc7c70d4..7e6234f4f 100644
--- a/src/backend/database/routes/proxmox.ts
+++ b/src/backend/database/routes/proxmox.ts
@@ -13,7 +13,12 @@ import { SSHHostKeyVerifier } from "../../hosts/host-key-verifier.js";
import { resolveHostById } from "../../hosts/host-resolver.js";
import { createJumpHostChain } from "../../hosts/jump-host-chain.js";
import { resolveProxmoxImportAuth } from "./proxmox-import-auth.js";
+import {
+ parseProxmoxJumpHosts,
+ serializeProxmoxJumpHosts,
+} from "./proxmox-jump-hosts.js";
import { isSafeNodeName } from "../../hosts/proxmox-shared.js";
+import { execElevated } from "../../hosts/metrics/managers/exec-elevated.js";
const router = express.Router();
const proxmoxLogger = logger;
@@ -67,6 +72,26 @@ function execCommand(
});
}
+export async function execPveshCommand(
+ client: SSHClient,
+ command: string,
+ sudoPassword: string | undefined,
+ timeoutMs = 25000,
+): Promise {
+ if (!sudoPassword) {
+ return execCommand(client, command, timeoutMs);
+ }
+
+ const result = await execElevated(client, command, sudoPassword, {
+ forceSudo: true,
+ timeoutMs,
+ });
+ if (result.code !== 0) {
+ throw new Error(result.stderr || `Command exited with code ${result.code}`);
+ }
+ return result.stdout;
+}
+
// Parse all IPs from LXC net config, then return the one matching the preferred prefix.
function parseLxcIp(
config: Record,
@@ -183,20 +208,6 @@ type ProxmoxSyncResult = {
errors: string[];
};
-function parseJumpHostsField(raw: unknown): unknown[] | null {
- if (!raw) return null;
- if (Array.isArray(raw)) return raw;
- if (typeof raw === "string") {
- try {
- const parsed = JSON.parse(raw);
- return Array.isArray(parsed) ? parsed : null;
- } catch {
- return null;
- }
- }
- return null;
-}
-
function parseJsonObject(value: unknown): Record {
if (!value) return {};
if (typeof value === "object") return value as Record;
@@ -417,9 +428,10 @@ async function discoverProxmoxGuestsForHost(
throw error;
}
- const resourcesJson = await execCommand(
+ const resourcesJson = await execPveshCommand(
client,
"pvesh get /cluster/resources --output-format json 2>/dev/null",
+ host.sudoPassword,
);
let resources: Array>;
@@ -468,9 +480,10 @@ async function discoverProxmoxGuestsForHost(
if (g.type === "lxc") {
let configIp: string | null = null;
try {
- const cfgJson = await execCommand(
+ const cfgJson = await execPveshCommand(
client,
`pvesh get /nodes/${g.node}/lxc/${g.vmid}/config --output-format json 2>/dev/null`,
+ host.sudoPassword,
25000,
);
configIp = parseLxcIp(JSON.parse(cfgJson), config.preferredPrefixes);
@@ -482,9 +495,10 @@ async function discoverProxmoxGuestsForHost(
// Fall back to the live interface list for running containers.
if (g.status === "running") {
try {
- const ifRaw = await execCommand(
+ const ifRaw = await execPveshCommand(
client,
`pvesh get /nodes/${g.node}/lxc/${g.vmid}/interfaces --output-format json 2>/dev/null`,
+ host.sudoPassword,
12000,
);
const data = JSON.parse(ifRaw);
@@ -514,9 +528,10 @@ async function discoverProxmoxGuestsForHost(
}
if (g.type === "qemu" && g.status === "running") {
try {
- const ifJson = await execCommand(
+ const ifJson = await execPveshCommand(
client,
`pvesh get /nodes/${g.node}/qemu/${g.vmid}/agent/network-get-interfaces --output-format json 2>/dev/null`,
+ host.sudoPassword,
12000,
);
const data = JSON.parse(ifJson);
@@ -599,7 +614,7 @@ async function discoverProxmoxGuestsForHost(
guests,
credentialId: hostCredentialId,
defaultCredentialId: config.defaultCredentialId,
- jumpHosts: parseJumpHostsField(
+ jumpHosts: parseProxmoxJumpHosts(
(host as unknown as { jumpHosts?: unknown }).jumpHosts,
),
config,
@@ -770,9 +785,7 @@ async function syncProxmoxHost(
telnetPort: null,
defaultPath: "/",
tunnelConnections: "[]",
- jumpHosts:
- (discovery.host as unknown as { jumpHosts?: string | null })
- .jumpHosts ?? null,
+ jumpHosts: serializeProxmoxJumpHosts(discovery.jumpHosts),
quickActions: null,
statsConfig: null,
dockerConfig: null,
diff --git a/src/backend/database/routes/rbac.ts b/src/backend/database/routes/rbac.ts
index b8af05031..fbcc2ead4 100644
--- a/src/backend/database/routes/rbac.ts
+++ b/src/backend/database/routes/rbac.ts
@@ -3,7 +3,11 @@ import type { AuthenticatedRequest } from "../../../types/index.js";
import express, { type Response } from "express";
import { databaseLogger } from "../../utils/logger.js";
import { AuthManager } from "../../utils/auth-manager.js";
-import { getRequestMeta } from "../../utils/audit-logger.js";
+import {
+ getRequestMeta,
+ getAuditUsername,
+ logAudit,
+} from "../../utils/audit-logger.js";
import { isAuthOverrideProtocol } from "../../../types/auth-protocols.js";
import {
SharedHostAuthOverrideService,
@@ -15,11 +19,14 @@ import {
type SharePermissionLevel,
} from "../../utils/permission-manager.js";
import {
- PERMISSION_CATALOG,
+ getPermissionCatalog,
isValidPermission,
} from "../../utils/permission-catalog.js";
import {
createCurrentHostFolderRepository,
+ createCurrentFolderAccessRepository,
+ createCurrentCredentialRepository,
+ createCurrentCredentialAccessRepository,
createCurrentHostResolutionRepository,
createCurrentRbacAccessRepository,
createCurrentRoleRepository,
@@ -154,6 +161,7 @@ export function parseShareTargets(
router.post(
"/host/:id/share",
authenticateJWT,
+ permissionManager.requirePermission("hosts.share"),
async (req: AuthenticatedRequest, res: Response) => {
const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
const hostId = parseInt(id, 10);
@@ -365,6 +373,7 @@ router.post(
router.post(
"/folder/share",
authenticateJWT,
+ permissionManager.requirePermission("hosts.share"),
async (req: AuthenticatedRequest, res: Response) => {
const userId = req.userId!;
const { folder } = req.body ?? {};
@@ -422,6 +431,22 @@ router.post(
);
const expiresAt = expiryFromDuration(durationHours);
+
+ // Remember the share on the folder itself so hosts added later inherit it.
+ const folderAccessRepository = createCurrentFolderAccessRepository();
+ for (const target of targets) {
+ await folderAccessRepository.upsert({
+ ownerUserId: userId,
+ folder,
+ grantedBy: userId,
+ permissionLevel,
+ expiresAt,
+ target:
+ target.type === "user"
+ ? { targetType: "user", targetUserId: target.id as string }
+ : { targetType: "role", targetRoleId: target.id as number },
+ });
+ }
const rbacAccessRepository = createCurrentRbacAccessRepository();
const { SharedHostSecretsManager } =
await import("../../utils/shared-host-secrets-manager.js");
@@ -575,6 +600,78 @@ router.post(
* 500:
* description: Failed to update grant.
*/
+/**
+ * @openapi
+ * /rbac/folder/access:
+ * get:
+ * summary: Standing shares on one of your folders (inherited by hosts added later)
+ * tags:
+ * - RBAC
+ * parameters:
+ * - in: query
+ * name: folder
+ * required: true
+ * schema:
+ * type: string
+ */
+router.get(
+ "/folder/access",
+ authenticateJWT,
+ async (req: AuthenticatedRequest, res: Response) => {
+ const folder = String(req.query.folder ?? "");
+ if (!isNonEmptyString(folder)) {
+ return res.status(400).json({ error: "folder is required" });
+ }
+ try {
+ res.json({
+ rules: await createCurrentFolderAccessRepository().listForFolder(
+ req.userId!,
+ folder,
+ ),
+ });
+ } catch (error) {
+ databaseLogger.error("Failed to list folder access rules", error, {
+ operation: "list_folder_access",
+ });
+ res.status(500).json({ error: "Failed to list folder access" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /rbac/folder/access/{id}:
+ * delete:
+ * summary: Stop a folder share from applying to hosts added later
+ * description: Grants already fanned out to hosts stay; revoke those per host.
+ * tags:
+ * - RBAC
+ */
+router.delete(
+ "/folder/access/:id",
+ authenticateJWT,
+ async (req: AuthenticatedRequest, res: Response) => {
+ const ruleId = parseInt(String(req.params.id), 10);
+ if (isNaN(ruleId)) {
+ return res.status(400).json({ error: "Invalid rule ID" });
+ }
+ try {
+ const repository = createCurrentFolderAccessRepository();
+ if (!(await repository.findById(ruleId, req.userId!))) {
+ return res.status(404).json({ error: "Rule not found" });
+ }
+ await repository.deleteById(ruleId, req.userId!);
+ res.json({ success: true });
+ } catch (error) {
+ databaseLogger.error("Failed to delete folder access rule", error, {
+ operation: "delete_folder_access",
+ ruleId,
+ });
+ res.status(500).json({ error: "Failed to delete folder access" });
+ }
+ },
+);
+
router.patch(
"/host/:id/access/:accessId",
authenticateJWT,
@@ -939,7 +1036,7 @@ router.get(
router.post(
"/roles",
authenticateJWT,
- permissionManager.requireAdmin(),
+ permissionManager.requirePermission("admin.roles.manage"),
async (req: AuthenticatedRequest, res: Response) => {
const { name, displayName, description } = req.body;
@@ -1031,7 +1128,7 @@ router.post(
router.put(
"/roles/:id",
authenticateJWT,
- permissionManager.requireAdmin(),
+ permissionManager.requirePermission("admin.roles.manage"),
async (req: AuthenticatedRequest, res: Response) => {
const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
const roleId = parseInt(id, 10);
@@ -1141,7 +1238,7 @@ router.get(
"/permissions/catalog",
authenticateJWT,
async (_req: AuthenticatedRequest, res: Response) => {
- res.json({ catalog: PERMISSION_CATALOG });
+ res.json({ catalog: getPermissionCatalog() });
},
);
@@ -1174,7 +1271,7 @@ router.get(
router.delete(
"/roles/:id",
authenticateJWT,
- permissionManager.requireAdmin(),
+ permissionManager.requirePermission("admin.roles.manage"),
async (req: AuthenticatedRequest, res: Response) => {
const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
const roleId = parseInt(id, 10);
@@ -1217,6 +1314,53 @@ router.delete(
},
);
+/**
+ * @openapi
+ * /rbac/roles/{id}/members:
+ * get:
+ * summary: List the users holding a role
+ * tags:
+ * - RBAC
+ * parameters:
+ * - in: path
+ * name: id
+ * required: true
+ * schema:
+ * type: integer
+ * responses:
+ * 200:
+ * description: Role members.
+ * 404:
+ * description: Role not found.
+ */
+router.get(
+ "/roles/:id/members",
+ authenticateJWT,
+ permissionManager.requirePermission("admin.roles.manage"),
+ async (req: AuthenticatedRequest, res: Response) => {
+ const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
+ const roleId = parseInt(id, 10);
+
+ if (isNaN(roleId)) {
+ return res.status(400).json({ error: "Invalid role ID" });
+ }
+
+ try {
+ const roleRepository = createCurrentRoleRepository();
+ if (!(await roleRepository.findRoleById(roleId))) {
+ return res.status(404).json({ error: "Role not found" });
+ }
+ res.json({ members: await roleRepository.listRoleMembers(roleId) });
+ } catch (error) {
+ databaseLogger.error("Failed to list role members", error, {
+ operation: "list_role_members",
+ roleId,
+ });
+ res.status(500).json({ error: "Failed to list role members" });
+ }
+ },
+);
+
/**
* @openapi
* /rbac/users/{userId}/roles:
@@ -1257,7 +1401,7 @@ router.delete(
router.post(
"/users/:userId/roles",
authenticateJWT,
- permissionManager.requireAdmin(),
+ permissionManager.requirePermission("admin.roles.manage"),
async (req: AuthenticatedRequest, res: Response) => {
const targetUserId = Array.isArray(req.params.userId)
? req.params.userId[0]
@@ -1313,6 +1457,12 @@ router.post(
roleId,
targetUserId,
);
+ const { SharedCredentialSecretsManager } =
+ await import("../../utils/shared-credential-secrets-manager.js");
+ await SharedCredentialSecretsManager.getInstance().snapshotForRoleMember(
+ roleId,
+ targetUserId,
+ );
} catch (error) {
databaseLogger.error(
"Failed to snapshot shared host secrets for new role member",
@@ -1382,7 +1532,7 @@ router.post(
router.delete(
"/users/:userId/roles/:roleId",
authenticateJWT,
- permissionManager.requireAdmin(),
+ permissionManager.requirePermission("admin.roles.manage"),
async (req: AuthenticatedRequest, res: Response) => {
const targetUserId = Array.isArray(req.params.userId)
? req.params.userId[0]
@@ -1422,6 +1572,12 @@ router.delete(
roleId,
targetUserId,
);
+ const { createCurrentSharedCredentialSecretsRepository } =
+ await import("../repositories/factory.js");
+ await createCurrentSharedCredentialSecretsRepository().deleteForRoleMember(
+ roleId,
+ targetUserId,
+ );
} catch (cleanupError) {
databaseLogger.warn(
"Failed to clean shared host secrets after role removal",
@@ -1510,6 +1666,239 @@ router.get(
},
);
+// CREDENTIAL SHARING
+
+const CREDENTIAL_LEVELS = ["use", "manage"] as const;
+type CredentialLevel = (typeof CREDENTIAL_LEVELS)[number];
+
+/** Owner, or a recipient holding "manage". */
+async function canManageCredentialSharing(
+ userId: string,
+ credentialId: number,
+): Promise<{ allowed: boolean; ownerId: string | null }> {
+ const row = await createCurrentCredentialRepository().findById(credentialId);
+ if (!row) return { allowed: false, ownerId: null };
+ if (row.userId === userId) return { allowed: true, ownerId: row.userId };
+ const roleIds = await createCurrentRoleRepository().listUserRoleIds(userId);
+ const grant = await createCurrentCredentialAccessRepository().findActiveGrant(
+ credentialId,
+ userId,
+ roleIds,
+ );
+ return { allowed: grant?.permissionLevel === "manage", ownerId: row.userId };
+}
+
+/**
+ * @openapi
+ * /rbac/credential/{id}/share:
+ * post:
+ * summary: Share a credential with users or roles
+ * description: Recipients get a copy of the secrets re-encrypted under their own key. "use" lets them attach it to hosts and connect; "manage" also lets them edit and re-share. Owner or a "manage" recipient only.
+ * tags:
+ * - RBAC
+ */
+router.post(
+ "/credential/:id/share",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.share"),
+ async (req: AuthenticatedRequest, res: Response) => {
+ const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
+ const credentialId = parseInt(id, 10);
+ const userId = req.userId!;
+ if (isNaN(credentialId)) {
+ return res.status(400).json({ error: "Invalid credential ID" });
+ }
+ const targets = parseShareTargets(req.body ?? {});
+ if (!targets) {
+ return res.status(400).json({
+ error:
+ "targets must be a non-empty array of { type: 'user'|'role', id } entries",
+ });
+ }
+ const { durationHours, permissionLevel = "use" } = req.body ?? {};
+ if (!CREDENTIAL_LEVELS.includes(permissionLevel)) {
+ return res.status(400).json({
+ error: "Invalid permission level",
+ validLevels: CREDENTIAL_LEVELS,
+ });
+ }
+
+ try {
+ const sharing = await canManageCredentialSharing(userId, credentialId);
+ if (!sharing.allowed || !sharing.ownerId) {
+ return res
+ .status(403)
+ .json({ error: "Not allowed to share this credential" });
+ }
+ const ownerId = sharing.ownerId;
+
+ const userRepository = createCurrentUserRepository();
+ const roleRepository = createCurrentRoleRepository();
+ for (const target of targets) {
+ const found =
+ target.type === "user"
+ ? await userRepository.findById(target.id as string)
+ : await roleRepository.findRoleById(target.id as number);
+ if (!found) {
+ return res.status(404).json({
+ error: `Target ${target.type} not found`,
+ targetId: target.id,
+ });
+ }
+ }
+
+ const expiresAt = expiryFromDuration(durationHours);
+ const accessRepository = createCurrentCredentialAccessRepository();
+ const { SharedCredentialSecretsManager } =
+ await import("../../utils/shared-credential-secrets-manager.js");
+ const manager = SharedCredentialSecretsManager.getInstance();
+
+ for (const target of targets) {
+ if (target.type === "user" && target.id === ownerId) continue;
+ const grant = await accessRepository.upsert({
+ credentialId,
+ grantedBy: userId,
+ permissionLevel: permissionLevel as CredentialLevel,
+ expiresAt,
+ target:
+ target.type === "user"
+ ? { targetType: "user", targetUserId: target.id as string }
+ : { targetType: "role", targetRoleId: target.id as number },
+ });
+ try {
+ if (target.type === "user") {
+ await manager.snapshotForUser(
+ grant.id,
+ credentialId,
+ target.id as string,
+ ownerId,
+ );
+ } else {
+ await manager.snapshotForRole(
+ grant.id,
+ credentialId,
+ target.id as number,
+ ownerId,
+ );
+ }
+ } catch (snapshotError) {
+ databaseLogger.warn("Credential shared but secret snapshot failed", {
+ operation: "rbac_credential_share_snapshot_failed",
+ credentialId,
+ accessId: grant.id,
+ error: getErrorMessage(snapshotError),
+ });
+ }
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "credential_share",
+ resourceType: "credential",
+ resourceId: String(credentialId),
+ details: JSON.stringify({ targets, permissionLevel, expiresAt }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ res.json({ success: true, permissionLevel, expiresAt });
+ } catch (error) {
+ databaseLogger.error("Failed to share credential", error, {
+ operation: "share_credential",
+ credentialId,
+ userId,
+ });
+ res.status(500).json({ error: "Failed to share credential" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /rbac/credential/{id}/access:
+ * get:
+ * summary: List who a credential is shared with
+ * tags:
+ * - RBAC
+ */
+router.get(
+ "/credential/:id/access",
+ authenticateJWT,
+ async (req: AuthenticatedRequest, res: Response) => {
+ const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
+ const credentialId = parseInt(id, 10);
+ if (isNaN(credentialId)) {
+ return res.status(400).json({ error: "Invalid credential ID" });
+ }
+ try {
+ const sharing = await canManageCredentialSharing(
+ req.userId!,
+ credentialId,
+ );
+ if (!sharing.allowed) {
+ return res.status(403).json({ error: "Not allowed" });
+ }
+ res.json({
+ access:
+ await createCurrentCredentialAccessRepository().listForCredential(
+ credentialId,
+ ),
+ });
+ } catch (error) {
+ databaseLogger.error("Failed to list credential access", error, {
+ operation: "list_credential_access",
+ credentialId,
+ });
+ res.status(500).json({ error: "Failed to list credential access" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /rbac/credential/{id}/access/{accessId}:
+ * delete:
+ * summary: Revoke a credential share (recipients' copies are removed with it)
+ * tags:
+ * - RBAC
+ */
+router.delete(
+ "/credential/:id/access/:accessId",
+ authenticateJWT,
+ async (req: AuthenticatedRequest, res: Response) => {
+ const credentialId = parseInt(String(req.params.id), 10);
+ const accessId = parseInt(String(req.params.accessId), 10);
+ if (isNaN(credentialId) || isNaN(accessId)) {
+ return res.status(400).json({ error: "Invalid ID" });
+ }
+ try {
+ const sharing = await canManageCredentialSharing(
+ req.userId!,
+ credentialId,
+ );
+ if (!sharing.allowed) {
+ return res.status(403).json({ error: "Not allowed" });
+ }
+ const repository = createCurrentCredentialAccessRepository();
+ if (!(await repository.findById(accessId, credentialId))) {
+ return res.status(404).json({ error: "Access grant not found" });
+ }
+ await repository.revoke(accessId, credentialId);
+ res.json({ success: true });
+ } catch (error) {
+ databaseLogger.error("Failed to revoke credential access", error, {
+ operation: "revoke_credential_access",
+ credentialId,
+ accessId,
+ });
+ res.status(500).json({ error: "Failed to revoke credential access" });
+ }
+ },
+);
+
// SNIPPET SHARING
/**
@@ -1524,6 +1913,7 @@ router.get(
router.post(
"/snippet/:id/share",
authenticateJWT,
+ permissionManager.requirePermission("snippets.share"),
async (req: AuthenticatedRequest, res: Response) => {
const id = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
const snippetId = parseInt(id, 10);
@@ -1639,6 +2029,131 @@ router.post(
* tags:
* - RBAC
*/
+/**
+ * @openapi
+ * /rbac/snippet-folder/share:
+ * post:
+ * summary: Share every snippet in a folder
+ * description: Grants view access to each owned snippet in the folder (and its subfolders) to the given users or roles.
+ * tags:
+ * - RBAC
+ * requestBody:
+ * required: true
+ * content:
+ * application/json:
+ * schema:
+ * type: object
+ * properties:
+ * folder:
+ * type: string
+ * targets:
+ * type: array
+ * items:
+ * type: object
+ * properties:
+ * type:
+ * type: string
+ * enum: [user, role]
+ * id:
+ * oneOf:
+ * - type: string
+ * - type: integer
+ * durationHours:
+ * type: number
+ * responses:
+ * 200:
+ * description: Folder shared.
+ * 404:
+ * description: A target was not found.
+ */
+router.post(
+ "/snippet-folder/share",
+ authenticateJWT,
+ permissionManager.requirePermission("snippets.share"),
+ async (req: AuthenticatedRequest, res: Response) => {
+ const userId = req.userId!;
+ const { folder, durationHours } = req.body ?? {};
+
+ if (!isNonEmptyString(folder)) {
+ return res.status(400).json({ error: "Folder name is required" });
+ }
+
+ const targets = parseShareTargets(req.body ?? {});
+ if (!targets) {
+ return res.status(400).json({
+ error:
+ "targets must be a non-empty array of { type: 'user'|'role', id } entries",
+ });
+ }
+
+ try {
+ const userRepository = createCurrentUserRepository();
+ const roleRepository = createCurrentRoleRepository();
+ for (const target of targets) {
+ const found =
+ target.type === "user"
+ ? await userRepository.findById(target.id as string)
+ : await roleRepository.findRoleById(target.id as number);
+ if (!found) {
+ return res.status(404).json({
+ error: `Target ${target.type} not found`,
+ targetId: target.id,
+ });
+ }
+ }
+
+ const snippetsInFolder =
+ await createCurrentSnippetRepository().listOwnedSnippetsInFolder(
+ userId,
+ folder,
+ );
+ const expiresAt = expiryFromDuration(durationHours);
+ const rbacAccessRepository = createCurrentRbacAccessRepository();
+
+ for (const snippet of snippetsInFolder) {
+ for (const target of targets) {
+ if (target.type === "user" && target.id === userId) continue;
+ await rbacAccessRepository.upsertSnippetAccess({
+ snippetId: snippet.id,
+ grantedBy: userId,
+ expiresAt,
+ ...(target.type === "user"
+ ? {
+ targetType: "user" as const,
+ targetUserId: target.id as string,
+ }
+ : {
+ targetType: "role" as const,
+ targetRoleId: target.id as number,
+ }),
+ });
+ }
+ }
+
+ databaseLogger.success("Snippet folder shared successfully", {
+ operation: "rbac_snippet_folder_share",
+ userId,
+ folder,
+ snippetsShared: snippetsInFolder.length,
+ targets: targets.length,
+ });
+
+ res.json({
+ success: true,
+ expiresAt,
+ snippetsShared: snippetsInFolder.length,
+ });
+ } catch (error) {
+ databaseLogger.error("Failed to share snippet folder", error, {
+ operation: "share_snippet_folder",
+ folder,
+ userId,
+ });
+ res.status(500).json({ error: "Failed to share snippet folder" });
+ }
+ },
+);
+
router.delete(
"/snippet/:id/access/:accessId",
authenticateJWT,
diff --git a/src/backend/database/routes/secret-sources.ts b/src/backend/database/routes/secret-sources.ts
new file mode 100644
index 000000000..54f35aec1
--- /dev/null
+++ b/src/backend/database/routes/secret-sources.ts
@@ -0,0 +1,278 @@
+import crypto from "crypto";
+import express, { type Request, type Response } from "express";
+import type { AuthenticatedRequest } from "../../../types/index.js";
+import { AuthManager } from "../../utils/auth-manager.js";
+import { PermissionManager } from "../../utils/permission-manager.js";
+import { authLogger } from "../../utils/logger.js";
+import { getErrorMessage } from "../../utils/error-message.js";
+import {
+ logAudit,
+ getAuditUsername,
+ getRequestMeta,
+} from "../../utils/audit-logger.js";
+import { testConnectSource } from "../../utils/onepassword-connect.js";
+import { readSecretSourcePrivateAllowlist } from "../../utils/secret-source-egress.js";
+import { clearExternalSecretCache } from "../../hosts/external-secrets.js";
+import { createCurrentSecretSourceRepository } from "../repositories/factory.js";
+import {
+ toPublicSecretSource,
+ type SecretSourceRecord,
+} from "../repositories/secret-source-repository.js";
+
+const router = express.Router();
+const authManager = AuthManager.getInstance();
+const authenticateJWT = authManager.createAuthMiddleware();
+const requireDataAccess = authManager.createDataAccessMiddleware();
+const permissionManager = PermissionManager.getInstance();
+
+const KINDS = ["onepassword-connect"] as const;
+
+function isNonEmptyString(value: unknown): value is string {
+ return typeof value === "string" && value.trim().length > 0;
+}
+
+function validBaseUrl(raw: unknown): string | null {
+ if (!isNonEmptyString(raw)) return null;
+ try {
+ const url = new URL(raw.trim());
+ if (!["http:", "https:"].includes(url.protocol)) return null;
+ return url.toString().replace(/\/+$/, "");
+ } catch {
+ return null;
+ }
+}
+
+async function loadOwned(
+ id: string,
+ userId: string,
+ res: Response,
+): Promise {
+ const source = await createCurrentSecretSourceRepository().findById(id);
+ if (!source) {
+ res.status(404).json({ error: "Secret source not found" });
+ return null;
+ }
+ if (source.userId !== userId) {
+ res.status(403).json({ error: "Only the owner can change this source" });
+ return null;
+ }
+ return source;
+}
+
+/**
+ * @openapi
+ * /secret-sources:
+ * get:
+ * summary: List secret sources visible to the caller (own + shared)
+ * tags:
+ * - Secret Sources
+ */
+router.get(
+ "/",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ try {
+ const rows =
+ await createCurrentSecretSourceRepository().listVisibleToUser(userId);
+ res.json({
+ sources: rows.map((row) => ({
+ ...toPublicSecretSource(row),
+ owned: row.userId === userId,
+ })),
+ });
+ } catch (error) {
+ authLogger.error("Failed to list secret sources", error);
+ res.status(500).json({ error: "Failed to list secret sources" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /secret-sources:
+ * post:
+ * summary: Create a secret source (1Password Connect)
+ * description: Sharing a source with every user requires admin. The token is encrypted with the owner's data key.
+ * tags:
+ * - Secret Sources
+ */
+router.post(
+ "/",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.create"),
+ requireDataAccess,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const {
+ name,
+ kind = "onepassword-connect",
+ baseUrl,
+ token,
+ shared,
+ } = req.body ?? {};
+ const url = validBaseUrl(baseUrl);
+ if (!isNonEmptyString(name) || !url || !isNonEmptyString(token)) {
+ return res.status(400).json({
+ error: "name, a valid http(s) baseUrl and token are required",
+ });
+ }
+ if (!KINDS.includes(kind)) {
+ return res.status(400).json({ error: "Unsupported secret source kind" });
+ }
+ if (shared === true && !(await permissionManager.isAdmin(userId))) {
+ return res
+ .status(403)
+ .json({ error: "Only admins can share a secret source" });
+ }
+ try {
+ const created = await createCurrentSecretSourceRepository().create({
+ id: crypto.randomUUID(),
+ userId,
+ name: name.trim(),
+ kind,
+ baseUrl: url,
+ token: token.trim(),
+ shared: shared === true,
+ });
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "secret_source_create",
+ resourceType: "secret_source",
+ resourceId: created.id,
+ resourceName: created.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ source: { ...toPublicSecretSource(created), owned: true } });
+ } catch (error) {
+ authLogger.error("Failed to create secret source", error);
+ res.status(500).json({ error: "Failed to create secret source" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /secret-sources/{id}:
+ * put:
+ * summary: Update a secret source (owner only; omit token to keep it)
+ * tags:
+ * - Secret Sources
+ */
+router.put(
+ "/:id",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.edit"),
+ requireDataAccess,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const { name, baseUrl, token, shared } = req.body ?? {};
+ try {
+ const source = await loadOwned(String(req.params.id), userId, res);
+ if (!source) return;
+ const url = baseUrl === undefined ? undefined : validBaseUrl(baseUrl);
+ if (baseUrl !== undefined && !url) {
+ return res.status(400).json({ error: "baseUrl must be http(s)" });
+ }
+ if (
+ shared === true &&
+ !source.shared &&
+ !(await permissionManager.isAdmin(userId))
+ ) {
+ return res
+ .status(403)
+ .json({ error: "Only admins can share a secret source" });
+ }
+ await createCurrentSecretSourceRepository().update(source, {
+ ...(isNonEmptyString(name) ? { name: name.trim() } : {}),
+ ...(url ? { baseUrl: url } : {}),
+ ...(isNonEmptyString(token) ? { token: token.trim() } : {}),
+ ...(typeof shared === "boolean" ? { shared } : {}),
+ });
+ clearExternalSecretCache();
+ res.json({ success: true });
+ } catch (error) {
+ authLogger.error("Failed to update secret source", error);
+ res.status(500).json({ error: "Failed to update secret source" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /secret-sources/{id}:
+ * delete:
+ * summary: Delete a secret source (owner only)
+ * tags:
+ * - Secret Sources
+ */
+router.delete(
+ "/:id",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.delete"),
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ try {
+ const source = await loadOwned(String(req.params.id), userId, res);
+ if (!source) return;
+ await createCurrentSecretSourceRepository().deleteById(source.id);
+ clearExternalSecretCache();
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "secret_source_delete",
+ resourceType: "secret_source",
+ resourceId: source.id,
+ resourceName: source.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ authLogger.error("Failed to delete secret source", error);
+ res.status(500).json({ error: "Failed to delete secret source" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /secret-sources/{id}/test:
+ * post:
+ * summary: Check that the source is reachable and the token is accepted
+ * tags:
+ * - Secret Sources
+ */
+router.post(
+ "/:id/test",
+ authenticateJWT,
+ permissionManager.requirePermission("credentials.view"),
+ requireDataAccess,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ try {
+ const repository = createCurrentSecretSourceRepository();
+ const source = await repository.findById(String(req.params.id));
+ if (!source || (source.userId !== userId && !source.shared)) {
+ return res.status(404).json({ error: "Secret source not found" });
+ }
+ const vaults = await testConnectSource({
+ baseUrl: source.baseUrl,
+ token: repository.decryptToken(source),
+ allowedPrivateHosts: await readSecretSourcePrivateAllowlist(),
+ });
+ res.json({ ok: true, vaults });
+ } catch (error) {
+ res.status(200).json({ ok: false, error: getErrorMessage(error) });
+ }
+ },
+);
+
+export default router;
diff --git a/src/backend/database/routes/session-log-routes.ts b/src/backend/database/routes/session-log-routes.ts
index f1b5e1d6f..1a03fcc93 100644
--- a/src/backend/database/routes/session-log-routes.ts
+++ b/src/backend/database/routes/session-log-routes.ts
@@ -85,7 +85,7 @@ async function pruneOldLogs(): Promise {
// Run prune once at startup, then every 24 hours
pruneOldLogs();
-setInterval(pruneOldLogs, 24 * 60 * 60 * 1000);
+setInterval(pruneOldLogs, 24 * 60 * 60 * 1000).unref();
const authManager = AuthManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
diff --git a/src/backend/database/routes/snippets.ts b/src/backend/database/routes/snippets.ts
index 3f0e7b1d0..3c95ab601 100644
--- a/src/backend/database/routes/snippets.ts
+++ b/src/backend/database/routes/snippets.ts
@@ -2,6 +2,7 @@ import { getErrorMessage } from "../../utils/error-message.js";
import type { AuthenticatedRequest } from "../../../types/index.js";
import express, { type Request, type Response } from "express";
import { authLogger, databaseLogger } from "../../utils/logger.js";
+import { PermissionManager } from "../../utils/permission-manager.js";
import { AuthManager } from "../../utils/auth-manager.js";
import { SSH_ALGORITHMS } from "../../utils/ssh-algorithms.js";
import { extractSnippetReorderUpdates } from "./snippets-reorder.js";
@@ -11,8 +12,8 @@ import {
resolveSnippetCommand,
} from "./snippets-execution.js";
import { logAudit, getRequestMeta } from "../../utils/audit-logger.js";
+import { resolveHostById } from "../../hosts/host-resolver.js";
import {
- createCurrentHostResolutionRepository,
createCurrentRbacAccessRepository,
createCurrentRoleRepository,
createCurrentSnippetRepository,
@@ -68,6 +69,7 @@ async function getAccessibleSnippet(snippetId: number, userId: string) {
}
const authManager = AuthManager.getInstance();
+const permissionManager = PermissionManager.getInstance();
const authenticateJWT = authManager.createAuthMiddleware();
const requireDataAccess = authManager.createDataAccessMiddleware();
@@ -90,6 +92,7 @@ const requireDataAccess = authManager.createDataAccessMiddleware();
router.get(
"/folders",
authenticateJWT,
+ permissionManager.requirePermission("snippets.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -144,6 +147,7 @@ router.get(
router.post(
"/folders",
authenticateJWT,
+ permissionManager.requirePermission("snippets.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -226,6 +230,7 @@ router.post(
router.put(
"/folders/:name/metadata",
authenticateJWT,
+ permissionManager.requirePermission("snippets.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -306,6 +311,7 @@ router.put(
router.put(
"/folders/rename",
authenticateJWT,
+ permissionManager.requirePermission("snippets.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -382,6 +388,7 @@ router.put(
router.delete(
"/folders/:name",
authenticateJWT,
+ permissionManager.requirePermission("snippets.delete"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -466,6 +473,7 @@ router.delete(
router.put(
"/reorder",
authenticateJWT,
+ permissionManager.requirePermission("snippets.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -579,32 +587,16 @@ router.post(
}
const { Client } = await import("ssh2");
- const repository = createCurrentHostResolutionRepository();
- const host = await repository.findHostById(parseInt(hostId), userId);
+ const host = await resolveHostById(parseInt(hostId), userId);
- if (!host || host.userId !== userId) {
+ if (!host) {
return res.status(404).json({ error: "Host not found" });
}
- let password = host.password;
- let privateKey = host.key;
- let passphrase = host.keyPassword;
- let authType = host.authType;
-
- if (host.credentialId) {
- const cred = await repository.findCredentialByIdForUser(
- host.credentialId as number,
- userId,
- );
-
- if (cred) {
- authType = (cred.authType || authType) as string;
- password = (cred.password || undefined) as string | undefined;
- privateKey = (cred.privateKey || cred.key || undefined) as
- string | undefined;
- passphrase = (cred.keyPassword || undefined) as string | undefined;
- }
- }
+ const password = host.password;
+ const privateKey = host.key;
+ const passphrase = host.keyPassword;
+ const authType = host.authType;
const conn = new Client();
let output = "";
@@ -796,6 +788,7 @@ router.post(
router.get(
"/export",
authenticateJWT,
+ permissionManager.requirePermission("snippets.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -872,6 +865,7 @@ router.get(
router.post(
"/bulk-import",
authenticateJWT,
+ permissionManager.requirePermission("snippets.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -932,6 +926,7 @@ router.post(
router.get(
"/",
authenticateJWT,
+ permissionManager.requirePermission("snippets.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -1003,6 +998,7 @@ router.get(
router.get(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("snippets.view"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -1073,6 +1069,7 @@ router.get(
router.post(
"/",
authenticateJWT,
+ permissionManager.requirePermission("snippets.create"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -1183,6 +1180,7 @@ router.post(
router.put(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("snippets.edit"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
@@ -1261,6 +1259,7 @@ router.put(
router.delete(
"/:id",
authenticateJWT,
+ permissionManager.requirePermission("snippets.delete"),
requireDataAccess,
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId;
diff --git a/src/backend/database/routes/sync-references.ts b/src/backend/database/routes/sync-references.ts
index 1ed573ca3..1c4e0dc81 100644
--- a/src/backend/database/routes/sync-references.ts
+++ b/src/backend/database/routes/sync-references.ts
@@ -1,6 +1,6 @@
import type { SyncEntityType } from "../repositories/sync-tombstone-repository.js";
-export type SyncReferenceEntity = "sshCredentials" | "vaultProfiles";
+export type SyncReferenceEntity = "hosts" | "sshCredentials" | "vaultProfiles";
interface SyncReference {
field: string;
@@ -8,12 +8,14 @@ interface SyncReference {
entityType: SyncReferenceEntity;
}
+const CREDENTIAL_REFERENCE: SyncReference = {
+ field: "credentialId",
+ syncField: "credentialSyncId",
+ entityType: "sshCredentials",
+};
+
const HOST_REFERENCES: SyncReference[] = [
- {
- field: "credentialId",
- syncField: "credentialSyncId",
- entityType: "sshCredentials",
- },
+ CREDENTIAL_REFERENCE,
{
field: "rdpCredentialId",
syncField: "rdpCredentialSyncId",
@@ -34,11 +36,51 @@ const HOST_REFERENCES: SyncReference[] = [
syncField: "vaultProfileSyncId",
entityType: "vaultProfiles",
},
+ {
+ field: "parentHostId",
+ syncField: "parentHostSyncId",
+ entityType: "hosts",
+ },
];
+export function orderSyncRows(
+ entityType: SyncEntityType,
+ rows: Record[],
+): Record[] {
+ if (entityType !== "hosts") return rows;
+
+ const bySyncId = new Map(
+ rows
+ .filter((row) => typeof row.syncId === "string")
+ .map((row) => [row.syncId as string, row]),
+ );
+ const ordered: Record[] = [];
+ const visited = new Set>();
+ const visiting = new Set>();
+
+ const visit = (row: Record) => {
+ if (visited.has(row)) return;
+ if (visiting.has(row)) return;
+ visiting.add(row);
+
+ const parentSyncId = row.parentHostSyncId;
+ if (typeof parentSyncId === "string") {
+ const parent = bySyncId.get(parentSyncId);
+ if (parent) visit(parent);
+ }
+
+ visiting.delete(row);
+ visited.add(row);
+ ordered.push(row);
+ };
+
+ rows.forEach(visit);
+ return ordered;
+}
+
const REFERENCES: Partial> = {
hosts: HOST_REFERENCES,
- sshFolders: [HOST_REFERENCES[0]],
+ sshFolders: [CREDENTIAL_REFERENCE],
};
export async function serializeSyncReferences(
diff --git a/src/backend/database/routes/sync.ts b/src/backend/database/routes/sync.ts
index 4796e8cdf..c3d4bcf19 100644
--- a/src/backend/database/routes/sync.ts
+++ b/src/backend/database/routes/sync.ts
@@ -23,10 +23,12 @@ import {
import type { SyncEntityType } from "../repositories/sync-tombstone-repository.js";
import {
deserializeSyncReferences,
+ orderSyncRows,
serializeSyncReferences,
type SyncReferenceEntity,
} from "./sync-references.js";
import { timestampAtOrAfter } from "../sync-timestamp.js";
+import { validateParentHostId } from "./host-parent-validation.js";
const router = express.Router();
const authManager = AuthManager.getInstance();
@@ -115,6 +117,15 @@ async function findReferenceSyncId(
id: number,
userId: string,
): Promise {
+ if (entityType === "hosts") {
+ const [row] = await context.drizzle
+ .select({ syncId: hosts.syncId })
+ .from(hosts)
+ .where(and(eq(hosts.id, id), eq(hosts.userId, userId)))
+ .limit(1);
+ return row?.syncId ?? null;
+ }
+
if (entityType === "sshCredentials") {
const [row] = await context.drizzle
.select({ syncId: sshCredentials.syncId })
@@ -138,6 +149,15 @@ async function findReferenceId(
syncId: string,
userId: string,
): Promise {
+ if (entityType === "hosts") {
+ const [row] = await context.drizzle
+ .select({ id: hosts.id })
+ .from(hosts)
+ .where(and(eq(hosts.syncId, syncId), eq(hosts.userId, userId)))
+ .limit(1);
+ return row?.id ?? null;
+ }
+
if (entityType === "sshCredentials") {
const [row] = await context.drizzle
.select({ id: sshCredentials.id })
@@ -281,7 +301,7 @@ router.get(
}),
);
- res.json({ rows: decrypted });
+ res.json({ rows: orderSyncRows(entityType, decrypted) });
} catch (err) {
databaseLogger.error(`Failed to pull sync rows for ${entityType}`, err, {
operation: "sync_pull",
@@ -409,6 +429,17 @@ router.post(
(referenceType, referenceSyncId) =>
findReferenceId(context, referenceType, referenceSyncId, userId),
);
+ if (
+ entityType === "hosts" &&
+ typeof resolvedPayload.parentHostId === "number"
+ ) {
+ const parentError = await validateParentHostId(
+ userId,
+ typeof existing?.id === "number" ? existing.id : null,
+ resolvedPayload.parentHostId,
+ );
+ if (parentError) return res.status(400).json({ error: parentError });
+ }
const writePayload = stripWritePayload(entityType, resolvedPayload);
const encryptedPayload = encryptIfNeeded(
entityType,
diff --git a/src/backend/database/routes/user-preferences.ts b/src/backend/database/routes/user-preferences.ts
index 6037f3ced..82a55502f 100644
--- a/src/backend/database/routes/user-preferences.ts
+++ b/src/backend/database/routes/user-preferences.ts
@@ -26,6 +26,7 @@ const pickPreferences = (row?: UserPreferenceRecord | null) => ({
hostTrayOnClick: row?.hostTrayOnClick ?? null,
pinAppRail: row?.pinAppRail ?? null,
expandAppRailOnHover: row?.expandAppRailOnHover ?? null,
+ showPinAppRailButton: row?.showPinAppRailButton ?? null,
foldersCollapsed: row?.foldersCollapsed ?? null,
confirmSnippetExecution: row?.confirmSnippetExecution ?? null,
disableUpdateCheck: row?.disableUpdateCheck ?? null,
@@ -105,6 +106,9 @@ export function validateDefaultsJson(value: string): boolean {
* expandAppRailOnHover:
* type: boolean
* nullable: true
+ * showPinAppRailButton:
+ * type: boolean
+ * nullable: true
* foldersCollapsed:
* type: boolean
* nullable: true
@@ -186,6 +190,8 @@ router.get("/", authenticateJWT, async (req: Request, res: Response) => {
* type: boolean
* expandAppRailOnHover:
* type: boolean
+ * showPinAppRailButton:
+ * type: boolean
* confirmSnippetExecution:
* type: boolean
* disableUpdateCheck:
@@ -217,6 +223,7 @@ router.put("/", authenticateJWT, async (req: Request, res: Response) => {
commandPaletteEnabled,
pinAppRail,
expandAppRailOnHover,
+ showPinAppRailButton,
confirmSnippetExecution,
disableUpdateCheck,
confirmTabClose,
@@ -239,6 +246,7 @@ router.put("/", authenticateJWT, async (req: Request, res: Response) => {
commandPaletteEnabled?: boolean | null;
pinAppRail?: boolean | null;
expandAppRailOnHover?: boolean | null;
+ showPinAppRailButton?: boolean | null;
confirmSnippetExecution?: boolean | null;
disableUpdateCheck?: boolean | null;
confirmTabClose?: boolean | null;
@@ -384,6 +392,7 @@ router.put("/", authenticateJWT, async (req: Request, res: Response) => {
commandPaletteEnabled,
pinAppRail,
expandAppRailOnHover,
+ showPinAppRailButton,
confirmSnippetExecution,
disableUpdateCheck,
confirmTabClose,
@@ -413,6 +422,8 @@ router.put("/", authenticateJWT, async (req: Request, res: Response) => {
if (pinAppRail !== undefined) updates.pinAppRail = pinAppRail;
if (expandAppRailOnHover !== undefined)
updates.expandAppRailOnHover = expandAppRailOnHover;
+ if (showPinAppRailButton !== undefined)
+ updates.showPinAppRailButton = showPinAppRailButton;
if (confirmSnippetExecution !== undefined)
updates.confirmSnippetExecution = confirmSnippetExecution;
if (disableUpdateCheck !== undefined)
diff --git a/src/backend/database/routes/user-settings-routes.ts b/src/backend/database/routes/user-settings-routes.ts
index 404a44ce5..0e54ace69 100644
--- a/src/backend/database/routes/user-settings-routes.ts
+++ b/src/backend/database/routes/user-settings-routes.ts
@@ -1,4 +1,5 @@
import type { AuthenticatedRequest } from "../../../types/index.js";
+import { getErrorMessage } from "../../utils/error-message.js";
import type { RequestHandler, Router } from "express";
import { restartGuacServer } from "../../hosts/guacamole/guacamole-server.js";
import {
@@ -7,8 +8,19 @@ import {
setGlobalLogLevel,
} from "../../utils/logger.js";
import { logAudit, getRequestMeta } from "../../utils/audit-logger.js";
+import {
+ AUDIT_FORWARD_TOKEN_SETTING,
+ AUDIT_FORWARD_URL_ENV,
+ AUDIT_FORWARD_URL_SETTING,
+} from "../../utils/audit-forwarder.js";
import { getTelemetryEnvOverride } from "../../utils/analytics.js";
import { AI_PRIVATE_ALLOWLIST_KEY, parseAllowlist } from "../../ai/egress.js";
+import { STEP_CA_PRIVATE_ALLOWLIST_KEY } from "../../utils/step-ca-egress.js";
+import { SECRET_SOURCE_PRIVATE_ALLOWLIST_KEY } from "../../utils/secret-source-egress.js";
+import {
+ NOTIFICATION_PRIVATE_ALLOWLIST_KEY,
+ parseNotificationAllowlist,
+} from "../../utils/notification-egress.js";
import {
createCurrentSettingsRepository,
createCurrentUserRepository,
@@ -35,6 +47,7 @@ export type HostDefaults = {
cursorBlink?: boolean;
enableSessionLogging?: boolean;
enableCommandHistory?: boolean;
+ autoTmux?: boolean;
};
async function getAdminActor(
@@ -669,6 +682,125 @@ export function registerUserSettingsRoutes(
* enabled:
* type: boolean
*/
+ /**
+ * @openapi
+ * /users/audit-forwarding:
+ * get:
+ * summary: Get audit log forwarding settings (admin only)
+ * tags:
+ * - Users
+ * responses:
+ * 200:
+ * description: Forwarding target. The token itself is never returned.
+ */
+ router.get("/audit-forwarding", authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ if (!(await getAdminActor(userId))) {
+ return res.status(403).json({ error: "Not authorized" });
+ }
+ const settingsRepository = createCurrentSettingsRepository();
+ const url =
+ (await settingsRepository.get(AUDIT_FORWARD_URL_SETTING)) ?? "";
+ const hasToken = !!(await settingsRepository.get(
+ AUDIT_FORWARD_TOKEN_SETTING,
+ ));
+ res.json({
+ url,
+ hasToken,
+ envConfigured: !!process.env[AUDIT_FORWARD_URL_ENV]?.trim(),
+ });
+ } catch (err) {
+ authLogger.error("Failed to get audit forwarding settings", err);
+ res
+ .status(500)
+ .json({ error: "Failed to get audit forwarding settings" });
+ }
+ });
+
+ /**
+ * @openapi
+ * /users/audit-forwarding:
+ * patch:
+ * summary: Update audit log forwarding settings (admin only)
+ * description: Sets the collector URL audit entries are shipped to. An empty URL disables forwarding and clears the stored token. Omitting token keeps the stored one.
+ * tags:
+ * - Users
+ * requestBody:
+ * required: true
+ * content:
+ * application/json:
+ * schema:
+ * type: object
+ * properties:
+ * url:
+ * type: string
+ * token:
+ * type: string
+ * responses:
+ * 200:
+ * description: Setting updated.
+ * 403:
+ * description: Not authorized.
+ */
+ router.patch("/audit-forwarding", authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ const actor = await getAdminActor(userId);
+ if (!actor) {
+ return res.status(403).json({ error: "Not authorized" });
+ }
+ const { url, token } = req.body ?? {};
+ if (
+ typeof url !== "string" ||
+ (token !== undefined && typeof token !== "string")
+ ) {
+ return res.status(400).json({ error: "url must be a string" });
+ }
+ const trimmedUrl = url.trim();
+ if (trimmedUrl && !/^https?:\/\//i.test(trimmedUrl)) {
+ return res.status(400).json({ error: "url must be http(s)" });
+ }
+
+ const settingsRepository = createCurrentSettingsRepository();
+ if (!trimmedUrl) {
+ await settingsRepository.delete(AUDIT_FORWARD_URL_SETTING);
+ await settingsRepository.delete(AUDIT_FORWARD_TOKEN_SETTING);
+ } else {
+ await settingsRepository.set(AUDIT_FORWARD_URL_SETTING, trimmedUrl);
+ if (token !== undefined) {
+ if (token.trim()) {
+ await settingsRepository.set(
+ AUDIT_FORWARD_TOKEN_SETTING,
+ token.trim(),
+ );
+ } else {
+ await settingsRepository.delete(AUDIT_FORWARD_TOKEN_SETTING);
+ }
+ }
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: actor.username ?? userId,
+ action: "update_audit_forwarding",
+ resourceType: "setting",
+ details: JSON.stringify({ enabled: !!trimmedUrl }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ res.json({ url: trimmedUrl, hasToken: !!token?.trim() });
+ } catch (err) {
+ authLogger.error("Failed to update audit forwarding settings", err);
+ res
+ .status(500)
+ .json({ error: "Failed to update audit forwarding settings" });
+ }
+ });
+
router.get("/session-sharing-enabled", authenticateJWT, async (_req, res) => {
try {
res.json({
@@ -954,6 +1086,250 @@ export function registerUserSettingsRoutes(
}
});
+ /**
+ * GET/PATCH a comma-list of private hosts an outbound feature may reach.
+ * Shared by notifications and Step CA; each keeps its own setting key.
+ */
+ const registerPrivateEndpointAllowlist = (
+ path: string,
+ settingKey: string,
+ auditAction: string,
+ label: string,
+ ) => {
+ router.get(path, authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ if (!(await getAdminActor(userId))) {
+ return res.status(403).json({ error: "Not authorized" });
+ }
+ const raw = await createCurrentSettingsRepository().get(settingKey);
+ res.json({ hosts: parseNotificationAllowlist(raw) });
+ } catch (err) {
+ authLogger.error(`Failed to get ${label} allowlist`, err);
+ res.status(500).json({ error: "Failed to get the allowlist" });
+ }
+ });
+
+ router.patch(path, authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ const actor = await getAdminActor(userId);
+ if (!actor) {
+ return res.status(403).json({ error: "Not authorized" });
+ }
+
+ const { hosts } = req.body;
+ if (!Array.isArray(hosts)) {
+ return res.status(400).json({ error: "hosts must be an array" });
+ }
+ if (hosts.length > 50) {
+ return res
+ .status(400)
+ .json({ error: "At most 50 hosts are allowed" });
+ }
+ const cleaned: string[] = [];
+ for (const entry of hosts) {
+ if (typeof entry !== "string") {
+ return res
+ .status(400)
+ .json({ error: "Each host must be a string" });
+ }
+ const host = entry.trim().toLowerCase();
+ if (!host) continue;
+ if (!/^[a-z0-9._:-]+$/.test(host)) {
+ return res
+ .status(400)
+ .json({ error: `${entry} is not a valid hostname` });
+ }
+ if (!cleaned.includes(host)) cleaned.push(host);
+ }
+
+ await createCurrentSettingsRepository().set(
+ settingKey,
+ JSON.stringify(cleaned),
+ );
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: actor.username ?? userId,
+ action: auditAction,
+ resourceType: "setting",
+ details: JSON.stringify({ hosts: cleaned }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ hosts: cleaned });
+ } catch (err) {
+ authLogger.error(`Failed to update ${label} allowlist`, err);
+ res.status(500).json({ error: "Failed to update the allowlist" });
+ }
+ });
+ };
+
+ /**
+ * @openapi
+ * /users/notification-private-endpoints:
+ * get:
+ * summary: Get the private hosts notification channels may contact (admin only)
+ * tags:
+ * - Users
+ * patch:
+ * summary: Replace that allowlist (admin only)
+ * tags:
+ * - Users
+ */
+ registerPrivateEndpointAllowlist(
+ "/notification-private-endpoints",
+ NOTIFICATION_PRIVATE_ALLOWLIST_KEY,
+ "update_notification_private_endpoints",
+ "notification endpoint",
+ );
+
+ /**
+ * @openapi
+ * /users/step-ca-private-endpoints:
+ * get:
+ * summary: Get the private hosts the Step CA certificate flow may contact (admin only)
+ * tags:
+ * - Users
+ * patch:
+ * summary: Replace that allowlist (admin only)
+ * tags:
+ * - Users
+ */
+ registerPrivateEndpointAllowlist(
+ "/step-ca-private-endpoints",
+ STEP_CA_PRIVATE_ALLOWLIST_KEY,
+ "update_step_ca_private_endpoints",
+ "Step CA endpoint",
+ );
+
+ /**
+ * @openapi
+ * /users/secret-source-private-endpoints:
+ * get:
+ * summary: Get the private hosts secret sources (1Password Connect) may contact (admin only)
+ * tags:
+ * - Users
+ * patch:
+ * summary: Replace that allowlist (admin only)
+ * tags:
+ * - Users
+ */
+ registerPrivateEndpointAllowlist(
+ "/secret-source-private-endpoints",
+ SECRET_SOURCE_PRIVATE_ALLOWLIST_KEY,
+ "update_secret_source_private_endpoints",
+ "secret source endpoint",
+ );
+
+ /**
+ * @openapi
+ * /users/step-ca-settings:
+ * get:
+ * summary: Step CA settings. Admins get the values; everyone else only whether it is configured.
+ * tags:
+ * - Users
+ * patch:
+ * summary: Set the Step CA URL, root fingerprint and OIDC provisioner (admin only). Empty values clear the configuration.
+ * tags:
+ * - Users
+ */
+ router.get("/step-ca-settings", authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ const { readStepCaSettings } =
+ await import("../../hosts/step-ca-auth.js");
+ const settings = await readStepCaSettings();
+ if (!(await getAdminActor(userId))) {
+ return res.json({ configured: settings !== null });
+ }
+ res.json({
+ configured: settings !== null,
+ caUrl: settings?.caUrl ?? "",
+ fingerprint: settings?.fingerprint ?? "",
+ provisioner: settings?.provisioner ?? "",
+ });
+ } catch (err) {
+ authLogger.error("Failed to get Step CA settings", err);
+ res.status(500).json({ error: "Failed to get Step CA settings" });
+ }
+ });
+
+ router.patch("/step-ca-settings", authenticateJWT, async (req, res) => {
+ const userId = (req as AuthenticatedRequest).userId;
+ try {
+ const actor = await getAdminActor(userId);
+ if (!actor) {
+ return res.status(403).json({ error: "Not authorized" });
+ }
+ const { caUrl, fingerprint, provisioner } = req.body ?? {};
+ if (
+ [caUrl, fingerprint, provisioner].some((v) => typeof v !== "string")
+ ) {
+ return res.status(400).json({
+ error: "caUrl, fingerprint and provisioner must be strings",
+ });
+ }
+ const values = {
+ caUrl: caUrl.trim(),
+ fingerprint: fingerprint.trim(),
+ provisioner: provisioner.trim(),
+ };
+ const clearing =
+ !values.caUrl && !values.fingerprint && !values.provisioner;
+ if (!clearing) {
+ const { normalizeCaUrl, normalizeFingerprint } =
+ await import("../../utils/step-ca-client.js");
+ try {
+ values.caUrl = normalizeCaUrl(values.caUrl);
+ values.fingerprint = normalizeFingerprint(values.fingerprint);
+ } catch (err) {
+ return res.status(400).json({ error: getErrorMessage(err) });
+ }
+ if (!values.provisioner) {
+ return res.status(400).json({ error: "provisioner is required" });
+ }
+ }
+
+ const { STEP_CA_SETTING_KEYS } =
+ await import("../../hosts/step-ca-auth.js");
+ const settings = createCurrentSettingsRepository();
+ if (clearing) {
+ await settings.delete(STEP_CA_SETTING_KEYS.url);
+ await settings.delete(STEP_CA_SETTING_KEYS.fingerprint);
+ await settings.delete(STEP_CA_SETTING_KEYS.provisioner);
+ } else {
+ await settings.set(STEP_CA_SETTING_KEYS.url, values.caUrl);
+ await settings.set(
+ STEP_CA_SETTING_KEYS.fingerprint,
+ values.fingerprint,
+ );
+ await settings.set(
+ STEP_CA_SETTING_KEYS.provisioner,
+ values.provisioner,
+ );
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: actor.username ?? userId,
+ action: "update_step_ca_settings",
+ resourceType: "setting",
+ details: JSON.stringify({ configured: !clearing, caUrl: values.caUrl }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ configured: !clearing, ...values });
+ } catch (err) {
+ authLogger.error("Failed to update Step CA settings", err);
+ res.status(500).json({ error: "Failed to update Step CA settings" });
+ }
+ });
+
/**
* @openapi
* /users/host-defaults:
diff --git a/src/backend/database/routes/user-totp-routes.ts b/src/backend/database/routes/user-totp-routes.ts
index 20501084a..6e055c117 100644
--- a/src/backend/database/routes/user-totp-routes.ts
+++ b/src/backend/database/routes/user-totp-routes.ts
@@ -130,7 +130,54 @@ export function registerUserTotpRoutes(
}
if (userRecord.totpEnabled) {
- return res.status(400).json({ error: "TOTP is already enabled" });
+ const credential = req.body?.credential;
+ if (!credential) {
+ return res.status(400).json({
+ error: "A TOTP code or password is required",
+ });
+ }
+
+ const userDataKey = authManager.getUserDataKey(userId);
+ let verified = await verifyTotpReauth(
+ userRecord,
+ credential,
+ userDataKey,
+ );
+ if (!verified && !userRecord.isOidc && userRecord.passwordHash) {
+ verified = await bcrypt.compare(credential, userRecord.passwordHash);
+ }
+ if (!verified) {
+ return res.status(401).json({
+ error: "Incorrect password or invalid TOTP code",
+ });
+ }
+
+ const existingSecret = userDataKey
+ ? LazyFieldEncryption.safeGetFieldValue(
+ userRecord.totpSecret,
+ userDataKey,
+ userId,
+ "totpSecret",
+ )
+ : userRecord.totpSecret;
+ if (!existingSecret) {
+ return res.status(409).json({ error: "TOTP secret is unavailable" });
+ }
+
+ const otpauthUrl = speakeasy.otpauthURL({
+ secret: existingSecret,
+ label: `Termix (${userRecord.username})`,
+ encoding: "base32",
+ });
+ authLogger.info("Additional TOTP authenticator enrollment started", {
+ operation: "totp_add_authenticator",
+ userId,
+ });
+ return res.json({
+ secret: existingSecret,
+ qr_code: await QRCode.toDataURL(otpauthUrl),
+ additional: true,
+ });
}
const secret = speakeasy.generateSecret({
diff --git a/src/backend/database/routes/user-webauthn-routes.ts b/src/backend/database/routes/user-webauthn-routes.ts
index aaaf51a14..848606a0e 100644
--- a/src/backend/database/routes/user-webauthn-routes.ts
+++ b/src/backend/database/routes/user-webauthn-routes.ts
@@ -400,12 +400,12 @@ export function registerUserWebAuthnRoutes(
* /users/webauthn/authenticate/verify:
* post:
* summary: Finish passkey login
- * description: Verifies the WebAuthn assertion and issues a session token (or a TOTP challenge).
+ * description: Verifies the WebAuthn assertion and issues a session token. Verified WebAuthn user verification satisfies 2FA; possession-only keys retain the configured TOTP challenge.
* tags:
* - WebAuthn
* responses:
* 200:
- * description: Login succeeded or TOTP verification required.
+ * description: Login succeeded.
* 400:
* description: Challenge expired or invalid response.
* 401:
@@ -488,7 +488,10 @@ export function registerUserWebAuthnRoutes(
},
);
- if (userRecord.totpEnabled) {
+ if (
+ userRecord.totpEnabled &&
+ verification.authenticationInfo.userVerified !== true
+ ) {
const deviceFingerprint = generateDeviceFingerprint(
deviceInfo,
getDeviceId(req),
diff --git a/src/backend/database/routes/users.ts b/src/backend/database/routes/users.ts
index 26763fbc2..815f128d7 100644
--- a/src/backend/database/routes/users.ts
+++ b/src/backend/database/routes/users.ts
@@ -22,6 +22,7 @@ import { deleteUserAndRelatedData } from "./delete-user-data.js";
import {
isLoopbackRequest,
extractBearerOrCookieToken,
+ isNativeTokenExportRequest,
resolveDesktopAutoSessionUser,
} from "./desktop-auto-session.js";
import { shouldShowDonationModal } from "./donation-modal-utils.js";
@@ -41,6 +42,7 @@ import {
} from "./user-oidc-utils.js";
import { registerUserApiKeyRoutes } from "./user-api-key-routes.js";
import { registerUserImageStorageRoutes } from "./user-image-storage-routes.js";
+import { registerBrandingRoutes } from "./branding-routes.js";
import { registerUserSettingsRoutes } from "./user-settings-routes.js";
import { registerTouchInputSettingsRoutes } from "./touch-input-settings-routes.js";
import { registerAcmeSSLRoutes } from "./acme-ssl-routes.js";
@@ -54,7 +56,7 @@ import { registerUserDataAccessRoutes } from "./user-data-access-routes.js";
import { registerSSOProviderRoutes } from "./sso-provider-routes.js";
import { registerLDAPAuthRoutes } from "./ldap-auth-routes.js";
import { logAudit, getRequestMeta } from "../../utils/audit-logger.js";
-import { notifyAutomationInternalEvent } from "../../hosts/metrics/automation-bridge.js";
+import { notifyAutomationInternalEvent } from "../../hosts/automation-events.js";
import {
createCurrentSettingsRepository,
getCurrentSettingValue,
@@ -91,6 +93,11 @@ async function syncSharedCredentialsForUserRoles(
const { SharedHostSecretsManager } =
await import("../../utils/shared-host-secrets-manager.js");
await SharedHostSecretsManager.getInstance().snapshotForUserRoles(userId);
+ const { SharedCredentialSecretsManager } =
+ await import("../../utils/shared-credential-secrets-manager.js");
+ await SharedCredentialSecretsManager.getInstance().snapshotForUserRoles(
+ userId,
+ );
} catch (error) {
authLogger.warn("Failed to sync role shared host secrets", {
operation,
@@ -2168,7 +2175,7 @@ router.post(
* /users/me/token:
* get:
* summary: Get current session token
- * description: Returns the JWT for the currently authenticated session. Intended for mobile WebView clients that cannot read HTTP-only cookies.
+ * description: Returns the JWT for the currently authenticated native Mobile or Desktop client. Browser sessions cannot export their HTTP-only cookie.
* tags:
* - Users
* responses:
@@ -2183,8 +2190,16 @@ router.post(
* type: string
* 401:
* description: Not authenticated.
+ * 403:
+ * description: Token export is not available to browser clients.
*/
router.get("/me/token", authenticateJWT, (req: Request, res: Response) => {
+ if (!isNativeTokenExportRequest(req)) {
+ return res
+ .status(403)
+ .json({ error: "Token export is limited to native clients" });
+ }
+
// authenticateJWT accepts either the jwt cookie or an Authorization:
// Bearer header (see auth-manager.ts's createAuthMiddleware) -- this must
// check both too, or a request that only carried the header (e.g. the
@@ -2971,7 +2986,21 @@ router.delete("/delete-user", authenticateJWT, async (req, res) => {
const targetUserId = targetUser.id;
- await deleteUserAndRelatedData(targetUserId);
+ // Inherit rather than drop: the deleting admin takes over the hosts and
+ // credentials unless another successor is named; "none" discards them.
+ const { successorUserId: requestedSuccessor } = req.body ?? {};
+ let successorUserId: string | undefined = userId;
+ if (requestedSuccessor === "none") {
+ successorUserId = undefined;
+ } else if (isNonEmptyString(requestedSuccessor)) {
+ const successor = await userRepository.findById(requestedSuccessor);
+ if (!successor || successor.id === targetUserId) {
+ return res.status(400).json({ error: "Invalid successor user" });
+ }
+ successorUserId = successor.id;
+ }
+
+ await deleteUserAndRelatedData(targetUserId, { successorUserId });
authLogger.warn("User account deleted by admin", {
operation: "admin_delete_user",
@@ -3033,6 +3062,7 @@ registerAcmeSSLRoutes(router, authenticateJWT);
registerUserApiKeyRoutes(router, requireAdmin);
registerUserImageStorageRoutes(router, requireAdmin);
+registerBrandingRoutes(router, requireAdmin);
registerSSOProviderRoutes(router);
registerLDAPAuthRoutes(router);
diff --git a/src/backend/hosts/auth-manager.ts b/src/backend/hosts/auth-manager.ts
index a1dfe43af..523ac3949 100644
--- a/src/backend/hosts/auth-manager.ts
+++ b/src/backend/hosts/auth-manager.ts
@@ -1,4 +1,5 @@
import type { WebSocket } from "ws";
+import { resolveExternalSecretRefs } from "./external-secrets.js";
import { sshLogger, authLogger } from "../utils/logger.js";
import { createCurrentHostResolutionRepository } from "../database/repositories/factory.js";
interface ResolvedCredentials {
@@ -63,6 +64,11 @@ export class SSHAuthManager {
);
if (cred) {
+ // Credentials may hold secret references instead of secrets.
+ await resolveExternalSecretRefs(
+ cred as unknown as Record,
+ this.context.userId,
+ );
resolvedCredentials = {
username: (cred.username as string) || hostConfig.username,
password: (cred.password as string) || undefined,
diff --git a/src/backend/hosts/automation-events.ts b/src/backend/hosts/automation-events.ts
new file mode 100644
index 000000000..662b5c612
--- /dev/null
+++ b/src/backend/hosts/automation-events.ts
@@ -0,0 +1,27 @@
+/**
+ * One-line hand-off from any hosts feature to the automations engine for a
+ * generic named event (not tied to metrics polling).
+ *
+ * Fire-and-forget and imported lazily: a failure in the automations layer
+ * must never disturb the caller, and a static import would create a cycle
+ * (automations reads repositories, which several hosts modules also pull in).
+ *
+ * PLUGIN-EVENT: this whole module is the "publish an internal event" half of
+ * the phase-2 ctx.events bus. Once that exists, callers should emit onto
+ * ctx.events instead of calling this directly, and the automations engine
+ * subscribes there rather than being imported ad hoc.
+ */
+
+export function notifyAutomationInternalEvent(
+ event: string,
+ userId: string,
+ hostId?: number,
+ details?: Record,
+): void {
+ if (!userId) return;
+ import("../automations/triggers.js")
+ .then((triggers) =>
+ triggers.onInternalEvent({ event, userId, hostId, details }),
+ )
+ .catch(() => {});
+}
diff --git a/src/backend/hosts/cloudflare-websocket.ts b/src/backend/hosts/cloudflare-websocket.ts
new file mode 100644
index 000000000..877792408
--- /dev/null
+++ b/src/backend/hosts/cloudflare-websocket.ts
@@ -0,0 +1,64 @@
+import { Duplex } from "node:stream";
+import type { RawData, WebSocket } from "ws";
+
+export function waitForWebSocketOpen(
+ socket: WebSocket,
+ timeoutMs: number,
+): Promise {
+ return new Promise((resolve, reject) => {
+ const cleanup = () => {
+ clearTimeout(timer);
+ socket.off("open", onOpen);
+ socket.off("error", onError);
+ };
+ const onOpen = () => {
+ cleanup();
+ resolve();
+ };
+ const onError = (error: Error) => {
+ cleanup();
+ socket.terminate();
+ reject(error);
+ };
+ const timer = setTimeout(() => {
+ cleanup();
+ socket.terminate();
+ reject(new Error("Cloudflare tunnel timeout"));
+ }, timeoutMs);
+
+ socket.once("open", onOpen);
+ socket.once("error", onError);
+ });
+}
+
+export function createWebSocketDuplex(socket: WebSocket): Duplex {
+ const duplex = new Duplex({
+ read() {},
+ write(chunk, _encoding, callback) {
+ try {
+ socket.send(chunk, (error) => callback(error || undefined));
+ } catch (error) {
+ callback(error instanceof Error ? error : new Error(String(error)));
+ }
+ },
+ destroy(error, callback) {
+ cleanup();
+ socket.terminate();
+ callback(error);
+ },
+ });
+
+ const onMessage = (data: RawData) => duplex.push(data);
+ const onClose = () => duplex.destroy();
+ const onError = () => duplex.destroy();
+ const cleanup = () => {
+ socket.off("message", onMessage);
+ socket.off("close", onClose);
+ socket.off("error", onError);
+ };
+
+ socket.on("message", onMessage);
+ socket.on("close", onClose);
+ socket.on("error", onError);
+ return duplex;
+}
diff --git a/src/backend/hosts/collab/guest-rate-limit.ts b/src/backend/hosts/collab/guest-rate-limit.ts
new file mode 100644
index 000000000..0d488d11f
--- /dev/null
+++ b/src/backend/hosts/collab/guest-rate-limit.ts
@@ -0,0 +1,21 @@
+const WINDOW_MS = 60_000;
+const MAX_ATTEMPTS = 60;
+const attempts = new Map();
+
+export function isCollabGuestRateLimited(ip: string): boolean {
+ const now = Date.now();
+ const entry = attempts.get(ip);
+ if (!entry || now - entry.windowStart > WINDOW_MS) {
+ attempts.set(ip, { count: 1, windowStart: now });
+ return false;
+ }
+ entry.count += 1;
+ return entry.count > MAX_ATTEMPTS;
+}
+
+setInterval(() => {
+ const now = Date.now();
+ for (const [ip, entry] of attempts) {
+ if (now - entry.windowStart > WINDOW_MS) attempts.delete(ip);
+ }
+}, 5 * WINDOW_MS).unref();
diff --git a/src/backend/hosts/collab/room-hub.ts b/src/backend/hosts/collab/room-hub.ts
new file mode 100644
index 000000000..c75d74d61
--- /dev/null
+++ b/src/backend/hosts/collab/room-hub.ts
@@ -0,0 +1,115 @@
+import type { WebSocket } from "ws";
+import { collabRuntimeStore } from "./runtime-store.js";
+
+const PRESENCE_HEARTBEAT_MS = 15_000;
+
+export interface CollabRoomClient {
+ ws: WebSocket;
+ userId: string;
+ username: string;
+}
+
+/**
+ * Local WebSocket fan-out plus optional Redis pub/sub for multi-instance room
+ * events and presence. The terminal WS server feeds subscribe/unsubscribe.
+ */
+class CollabRoomHub {
+ private rooms = new Map>();
+
+ constructor() {
+ collabRuntimeStore.onEvent((roomId, message) => {
+ if (
+ "type" in message &&
+ typeof message.type === "string" &&
+ message.type.startsWith("collab_internal_")
+ ) {
+ return;
+ }
+ this.broadcastLocal(roomId, message);
+ });
+ setInterval(() => {
+ for (const roomId of this.rooms.keys()) void this.refreshPresence(roomId);
+ }, PRESENCE_HEARTBEAT_MS).unref();
+ }
+
+ subscribe(roomId: string, client: CollabRoomClient): void {
+ let clients = this.rooms.get(roomId);
+ if (!clients) {
+ clients = new Set();
+ this.rooms.set(roomId, clients);
+ }
+ for (const existing of clients) {
+ if (existing.ws === client.ws) return;
+ }
+ clients.add(client);
+ void this.refreshPresence(roomId);
+ }
+
+ /** Drops the socket from one room, or from every room when roomId is omitted. */
+ unsubscribe(ws: WebSocket, roomId?: string): void {
+ for (const [id, clients] of this.rooms) {
+ if (roomId && id !== roomId) continue;
+ let removed = false;
+ for (const client of clients) {
+ if (client.ws === ws) {
+ clients.delete(client);
+ removed = true;
+ }
+ }
+ if (clients.size === 0) this.rooms.delete(id);
+ if (removed) void this.refreshPresence(id);
+ }
+ }
+
+ broadcast(roomId: string, message: object): void {
+ this.broadcastLocal(roomId, message);
+ void collabRuntimeStore.publish(roomId, message);
+ }
+
+ async onlineUsers(
+ roomId: string,
+ ): Promise> {
+ return collabRuntimeStore.onlineUsers(
+ roomId,
+ this.localOnlineUsers(roomId),
+ );
+ }
+
+ private broadcastLocal(roomId: string, message: object): void {
+ const clients = this.rooms.get(roomId);
+ if (!clients) return;
+ const payload = JSON.stringify(message);
+ for (const client of clients) {
+ if (client.ws.readyState !== client.ws.OPEN) continue;
+ try {
+ client.ws.send(payload);
+ } catch {
+ /* keep broadcasting to the rest */
+ }
+ }
+ }
+
+ private localOnlineUsers(
+ roomId: string,
+ ): Array<{ userId: string; username: string }> {
+ const clients = this.rooms.get(roomId);
+ if (!clients) return [];
+ const seen = new Map();
+ for (const client of clients) {
+ seen.set(client.userId, client.username);
+ }
+ return Array.from(seen, ([userId, username]) => ({ userId, username }));
+ }
+
+ private async refreshPresence(roomId: string): Promise {
+ const localUsers = this.localOnlineUsers(roomId);
+ await collabRuntimeStore.updatePresence(roomId, localUsers);
+ this.broadcast(roomId, {
+ type: "collab_online",
+ roomId,
+ users: await this.onlineUsers(roomId),
+ });
+ }
+}
+
+export const collabRoomHub = new CollabRoomHub();
diff --git a/src/backend/hosts/collab/room-share-access.ts b/src/backend/hosts/collab/room-share-access.ts
new file mode 100644
index 000000000..217e33fe4
--- /dev/null
+++ b/src/backend/hosts/collab/room-share-access.ts
@@ -0,0 +1,16 @@
+import { createCurrentCollabRoomRepository } from "../../database/repositories/factory.js";
+
+/**
+ * Whether a user may join a room-stage share: the share must be the stage of
+ * a live room they are a member of. Membership is the authorization - room
+ * stages are read-only and never expose host credentials or config.
+ */
+export async function canJoinRoomStageShare(
+ shareId: string,
+ userId: string,
+): Promise {
+ const repository = createCurrentCollabRoomRepository();
+ const room = await repository.findByStageShareId(shareId);
+ if (!room) return false;
+ return !!(await repository.findMember(room.id, userId));
+}
diff --git a/src/backend/hosts/collab/routes.ts b/src/backend/hosts/collab/routes.ts
new file mode 100644
index 000000000..5d7b4f3f7
--- /dev/null
+++ b/src/backend/hosts/collab/routes.ts
@@ -0,0 +1,1227 @@
+import crypto from "crypto";
+import express, { type Request, type Response } from "express";
+import type { AuthenticatedRequest } from "../../../types/index.js";
+import { AuthManager } from "../../utils/auth-manager.js";
+import { sshLogger } from "../../utils/logger.js";
+import {
+ logAudit,
+ getAuditUsername,
+ getRequestMeta,
+} from "../../utils/audit-logger.js";
+import { GuacamoleTokenService } from "../guacamole/token-service.js";
+import { collabRoomHub } from "./room-hub.js";
+import { getStageController, setStageController } from "./stage-control.js";
+import { isCollabGuestRateLimited } from "./guest-rate-limit.js";
+import {
+ collabRuntimeStore,
+ type CollabControlRequest,
+} from "./runtime-store.js";
+import { sessionManager } from "../terminal/session-manager.js";
+import {
+ isLiveSession,
+ isLiveSessionOwnedBy,
+ isSharingEnabledForHost,
+ type LiveProtocol,
+} from "../session-sharing/live-sessions.js";
+import {
+ createCurrentCollabRoomRepository,
+ createCurrentRoleRepository,
+ createCurrentSessionShareRepository,
+ createCurrentUserRepository,
+} from "../../database/repositories/factory.js";
+import type { CollabRoomRecord } from "../../database/repositories/collab-room-repository.js";
+
+/*
+ * Known limits, shared with session sharing v1:
+ * - Redis synchronizes collaboration events and ephemeral state across
+ * instances, but live session transports still require WebSocket affinity.
+ * - Guacamole stages stay read-only because guacamole-lite cannot revoke a
+ * writable viewer without disconnecting the whole shared session.
+ */
+const router = express.Router();
+const authManager = AuthManager.getInstance();
+const authenticateJWT = authManager.createAuthMiddleware();
+const tokenService = GuacamoleTokenService.getInstance();
+
+const STAGE_SHARE_EXPIRY_HOURS = 12;
+const MAX_INVITE_TARGETS = 200;
+const CONTROL_REQUEST_COOLDOWN_MS = 5000;
+const PROTOCOLS: LiveProtocol[] = ["ssh", "rdp", "vnc", "telnet"];
+
+function isNonEmptyString(value: unknown): value is string {
+ return typeof value === "string" && value.trim().length > 0;
+}
+
+async function requireRoomMember(
+ roomId: string,
+ userId: string,
+): Promise<{ room: CollabRoomRecord; isHost: boolean } | null> {
+ const repository = createCurrentCollabRoomRepository();
+ const room = await repository.findById(roomId);
+ if (!room || room.endedAt) return null;
+ const member = await repository.findMember(roomId, userId);
+ if (!member) return null;
+ return { room, isHost: member.roomRole === "host" };
+}
+
+async function revokeStageShare(room: CollabRoomRecord): Promise {
+ if (!room.stageShareId) return;
+ const repository = createCurrentSessionShareRepository();
+ const share = await repository.findActiveById(room.stageShareId);
+ if (!share) return;
+ if (!(await repository.revokeAsAdmin(room.stageShareId))) {
+ throw new Error("Failed to revoke the active stage share");
+ }
+ if (share.protocol === "ssh") {
+ sessionManager.disconnectShareParticipants(share.sessionId, share.id, {
+ reason: "The collaboration stage ended",
+ });
+ void collabRuntimeStore.publish(room.id, {
+ type: "collab_internal_stage_revoked",
+ sessionId: share.sessionId,
+ shareId: share.id,
+ });
+ }
+}
+
+function publicRoom(room: CollabRoomRecord) {
+ const { guestLinkToken: _secret, ...safeRoom } = room;
+ return { ...safeRoom, guestLinkEnabled: Boolean(_secret) };
+}
+
+function stagePayload(room: CollabRoomRecord) {
+ return {
+ presenterUserId: room.presenterUserId,
+ protocol: room.stageProtocol,
+ hostId: room.stageHostId,
+ shareId: room.stageShareId,
+ };
+}
+
+/**
+ * @openapi
+ * /collab/rooms:
+ * post:
+ * summary: Create a collaboration room
+ * tags:
+ * - Collab
+ */
+router.post("/rooms", authenticateJWT, async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const { name, persistent } = req.body ?? {};
+
+ if (!isNonEmptyString(name) || name.trim().length > 120) {
+ return res.status(400).json({ error: "Room name is required" });
+ }
+
+ try {
+ const repository = createCurrentCollabRoomRepository();
+ const room = await repository.createRoom({
+ id: crypto.randomUUID(),
+ name: name.trim(),
+ ownerUserId: userId,
+ persistent: persistent === true,
+ });
+ await repository.addMember({
+ roomId: room.id,
+ userId,
+ roomRole: "host",
+ addedBy: userId,
+ });
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_create",
+ resourceType: "collab_room",
+ resourceId: room.id,
+ resourceName: room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ res.json({ room: publicRoom(room) });
+ } catch (error) {
+ sshLogger.error("Failed to create collab room", error, {
+ operation: "collab_room_create_error",
+ });
+ res.status(500).json({ error: "Failed to create room" });
+ }
+});
+
+/**
+ * @openapi
+ * /collab/rooms:
+ * get:
+ * summary: List rooms the caller belongs to
+ * tags:
+ * - Collab
+ */
+router.get("/rooms", authenticateJWT, async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ try {
+ const rooms = await createCurrentCollabRoomRepository().listForUser(userId);
+ res.json({ rooms: rooms.map(publicRoom) });
+ } catch (error) {
+ sshLogger.error("Failed to list collab rooms", error, {
+ operation: "collab_room_list_error",
+ });
+ res.status(500).json({ error: "Failed to list rooms" });
+ }
+});
+
+/**
+ * @openapi
+ * /collab/rooms/{id}:
+ * get:
+ * summary: Get a room with members, online users and stage state
+ * tags:
+ * - Collab
+ */
+router.get(
+ "/rooms/:id",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ let access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+
+ // The presenter's own client never calls /stage (it drives the stage
+ // locally instead), so this is the only place that can notice its
+ // session died - e.g. the tab was closed without hitting "stop
+ // presenting". Without this, presenterUserId stays stuck pointing at a
+ // dead session forever, and the presenter's next visit shows the
+ // "presenting in another tab" dead end with nothing to stop.
+ if (access.room.stageShareId && access.room.stageProtocol) {
+ const share =
+ await createCurrentSessionShareRepository().findActiveById(
+ access.room.stageShareId,
+ );
+ const protocol = access.room.stageProtocol as LiveProtocol;
+ if (!share || !isLiveSession(protocol, share.sessionId)) {
+ await setStageController(roomId, null);
+ await createCurrentCollabRoomRepository().clearStage(roomId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage: null,
+ });
+ access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ }
+ }
+
+ const members =
+ await createCurrentCollabRoomRepository().listMembers(roomId);
+ const mayReviewControlRequests =
+ access.isHost || access.room.presenterUserId === userId;
+ const controlRequests = await collabRuntimeStore.listRequests(roomId);
+ res.json({
+ room: publicRoom(access.room),
+ me: userId,
+ isHost: access.isHost,
+ members,
+ online: await collabRoomHub.onlineUsers(roomId),
+ stage: stagePayload(access.room),
+ controllerUserId: await getStageController(roomId),
+ controlRequests: mayReviewControlRequests
+ ? controlRequests
+ : controlRequests.filter((request) => request.userId === userId),
+ });
+ } catch (error) {
+ sshLogger.error("Failed to get collab room", error, {
+ operation: "collab_room_get_error",
+ });
+ res.status(500).json({ error: "Failed to get room" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/members:
+ * post:
+ * summary: Invite users to a room (host only)
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/members",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const { userIds = [], roleIds = [] } = req.body ?? {};
+
+ if (
+ !Array.isArray(userIds) ||
+ userIds.some((id) => !isNonEmptyString(id)) ||
+ !Array.isArray(roleIds) ||
+ roleIds.some((id) => !Number.isInteger(id)) ||
+ (userIds.length === 0 && roleIds.length === 0)
+ ) {
+ return res.status(400).json({
+ error: "userIds (user ids) or roleIds (integers) are required",
+ });
+ }
+ if (userIds.length + roleIds.length > MAX_INVITE_TARGETS) {
+ return res.status(400).json({ error: "Too many invite targets" });
+ }
+
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.isHost) {
+ return res.status(403).json({ error: "Only the host can invite" });
+ }
+
+ const userRepository = createCurrentUserRepository();
+ const repository = createCurrentCollabRoomRepository();
+ for (const targetId of userIds as string[]) {
+ if (!(await userRepository.findById(targetId))) {
+ return res.status(404).json({ error: "User not found", targetId });
+ }
+ }
+ // Roles expand to their current members - a snapshot, like folder
+ // sharing; people joining the role later are not pulled in.
+ const roleRepository = createCurrentRoleRepository();
+ const expanded = new Set(userIds as string[]);
+ for (const roleId of roleIds as number[]) {
+ if (!(await roleRepository.findRoleById(roleId))) {
+ return res.status(404).json({ error: "Role not found", roleId });
+ }
+ for (const memberId of await roleRepository.listRoleUserIds(roleId)) {
+ expanded.add(memberId);
+ }
+ }
+ for (const targetId of expanded) {
+ await repository.addMember({
+ roomId,
+ userId: targetId,
+ roomRole: "member",
+ addedBy: userId,
+ });
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_invite",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ details: JSON.stringify({ memberCount: expanded.size }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_members_changed",
+ roomId,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to invite collab room members", error, {
+ operation: "collab_room_invite_error",
+ });
+ res.status(500).json({ error: "Failed to invite members" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/members/{userId}:
+ * delete:
+ * summary: Remove a member (host), or leave the room (self)
+ * tags:
+ * - Collab
+ */
+router.delete(
+ "/rooms/:id/members/:userId",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const targetId = String(req.params.userId);
+
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (targetId !== userId && !access.isHost) {
+ return res
+ .status(403)
+ .json({ error: "Only the host can remove members" });
+ }
+ if (targetId === access.room.ownerUserId) {
+ return res.status(400).json({ error: "The owner cannot be removed" });
+ }
+
+ const repository = createCurrentCollabRoomRepository();
+ await repository.removeMember(roomId, targetId);
+ await collabRuntimeStore.removeRequest(roomId, targetId);
+
+ if (access.room.stageShareId && access.room.stageProtocol === "ssh") {
+ const share =
+ await createCurrentSessionShareRepository().findActiveById(
+ access.room.stageShareId,
+ );
+ if (share) {
+ sessionManager.disconnectShareParticipants(
+ share.sessionId,
+ share.id,
+ {
+ userId: targetId,
+ reason: "You were removed from the collaboration room",
+ },
+ );
+ }
+ }
+
+ if ((await getStageController(roomId)) === targetId) {
+ await applyStageControl(access.room, roomId, null);
+ }
+
+ if (access.room.presenterUserId === targetId) {
+ await revokeStageShare(access.room);
+ await repository.clearStage(roomId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage: null,
+ });
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action:
+ targetId === userId
+ ? "collab_room_leave"
+ : "collab_room_remove_member",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ details: JSON.stringify({ targetUserId: targetId }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_members_changed",
+ roomId,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to remove collab room member", error, {
+ operation: "collab_room_remove_member_error",
+ });
+ res.status(500).json({ error: "Failed to remove member" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/present:
+ * post:
+ * summary: Take the stage with one of your live sessions
+ * description: Any member may take over the stage; the previous stage share is revoked. The caller must own the live session and sharing must be enabled for the host.
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/present",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const { protocol, sessionId, hostId } = req.body ?? {};
+
+ if (!PROTOCOLS.includes(protocol)) {
+ return res.status(400).json({ error: "Invalid protocol" });
+ }
+ if (!isNonEmptyString(sessionId) || !Number.isInteger(Number(hostId))) {
+ return res
+ .status(400)
+ .json({ error: "sessionId and hostId are required" });
+ }
+
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+
+ const numericHostId = Number(hostId);
+ const { enabled } = await isSharingEnabledForHost(numericHostId);
+ if (!enabled) {
+ return res
+ .status(403)
+ .json({ error: "Session sharing is disabled for this host" });
+ }
+ if (!isLiveSessionOwnedBy(protocol, String(sessionId), userId)) {
+ return res
+ .status(403)
+ .json({ error: "You do not own this live session" });
+ }
+
+ const shareRepository = createCurrentSessionShareRepository();
+ const share = await shareRepository.create({
+ id: crypto.randomUUID(),
+ hostId: numericHostId,
+ ownerUserId: userId,
+ protocol,
+ sessionId: String(sessionId),
+ shareType: "room",
+ permissionLevel: "read-only",
+ expiresAt: new Date(
+ Date.now() + STAGE_SHARE_EXPIRY_HOURS * 60 * 60 * 1000,
+ ).toISOString(),
+ });
+
+ await revokeStageShare(access.room);
+ const repository = createCurrentCollabRoomRepository();
+ const replaced = await repository.replaceStage(
+ roomId,
+ access.room.stageShareId,
+ {
+ presenterUserId: userId,
+ stageProtocol: protocol,
+ stageHostId: numericHostId,
+ stageShareId: share.id,
+ },
+ );
+ if (!replaced) {
+ await shareRepository.revokeAsAdmin(share.id);
+ return res.status(409).json({ error: "The stage changed; try again" });
+ }
+ await setStageController(roomId, null);
+ await collabRuntimeStore.clearRequests(roomId);
+
+ const stage = {
+ presenterUserId: userId,
+ protocol,
+ hostId: numericHostId,
+ shareId: share.id,
+ };
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage,
+ });
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_present",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ details: JSON.stringify({ protocol, hostId: numericHostId }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+
+ res.json({ stage });
+ } catch (error) {
+ sshLogger.error("Failed to take collab room stage", error, {
+ operation: "collab_room_present_error",
+ });
+ res.status(500).json({ error: "Failed to start presenting" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/stop:
+ * post:
+ * summary: Stop presenting (presenter or host)
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/stop",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (access.room.presenterUserId !== userId && !access.isHost) {
+ return res
+ .status(403)
+ .json({ error: "Only the presenter or host can stop the stage" });
+ }
+
+ await revokeStageShare(access.room);
+ await setStageController(roomId, null);
+ await collabRuntimeStore.clearRequests(roomId);
+ await createCurrentCollabRoomRepository().clearStage(roomId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage: null,
+ });
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_stop_presenting",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to stop collab room stage", error, {
+ operation: "collab_room_stop_error",
+ });
+ res.status(500).json({ error: "Failed to stop presenting" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/stage:
+ * get:
+ * summary: Get connect info for the current stage (members only)
+ * description: SSH stages are joined over the terminal WS by shareId; guac stages get a freshly minted read-only join token.
+ * tags:
+ * - Collab
+ */
+router.get(
+ "/rooms/:id/stage",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ const { room } = access;
+ if (!room.stageShareId || !room.stageProtocol) {
+ return res.json({ stage: null });
+ }
+
+ const share = await createCurrentSessionShareRepository().findActiveById(
+ room.stageShareId,
+ );
+ const protocol = room.stageProtocol as LiveProtocol;
+ if (!share || !isLiveSession(protocol, share.sessionId)) {
+ // The presenter is gone (expired share or dead session): clear the
+ // stale stage so the room stops pointing at it.
+ await setStageController(roomId, null);
+ await createCurrentCollabRoomRepository().clearStage(roomId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage: null,
+ });
+ return res.json({ stage: null });
+ }
+
+ const controllerUserId = await getStageController(roomId);
+ const stage: Record = {
+ ...stagePayload(room),
+ sessionId: share.sessionId,
+ controllerUserId,
+ };
+ if (protocol !== "ssh") {
+ stage.connectParams = {
+ token: tokenService.createJoinToken(share.sessionId, true),
+ };
+ }
+ res.json({ stage });
+ } catch (error) {
+ sshLogger.error("Failed to resolve collab room stage", error, {
+ operation: "collab_room_stage_error",
+ });
+ res.status(500).json({ error: "Failed to resolve stage" });
+ }
+ },
+);
+
+/** Sets the controller everywhere it lives: memory, live SSH gate, hub. */
+async function applyStageControl(
+ room: CollabRoomRecord,
+ roomId: string,
+ controllerUserId: string | null,
+): Promise {
+ await setStageController(roomId, controllerUserId);
+ if (room.stageShareId && room.stageProtocol === "ssh") {
+ try {
+ const share = await createCurrentSessionShareRepository().findActiveById(
+ room.stageShareId,
+ );
+ if (share) {
+ sessionManager.setRoomShareControl(
+ share.sessionId,
+ share.id,
+ controllerUserId,
+ );
+ }
+ } catch {
+ // The gate keeps its previous state; the broadcast still lands.
+ }
+ }
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_control_changed",
+ roomId,
+ controllerUserId,
+ });
+}
+
+collabRuntimeStore.onEvent((roomId, message) => {
+ if (!("type" in message) || typeof message.type !== "string") return;
+ if (message.type === "collab_control_changed") {
+ const controllerUserId: string | null =
+ "controllerUserId" in message &&
+ typeof message.controllerUserId === "string"
+ ? message.controllerUserId
+ : null;
+ void createCurrentCollabRoomRepository()
+ .findById(roomId)
+ .then((room) => {
+ if (!room?.stageShareId || room.stageProtocol !== "ssh") return;
+ return createCurrentSessionShareRepository()
+ .findActiveById(room.stageShareId)
+ .then((share) => {
+ if (share) {
+ sessionManager.setRoomShareControl(
+ share.sessionId,
+ share.id,
+ controllerUserId,
+ );
+ }
+ });
+ })
+ .catch(() => {});
+ }
+ if (
+ message.type === "collab_internal_stage_revoked" &&
+ "sessionId" in message &&
+ typeof message.sessionId === "string" &&
+ "shareId" in message &&
+ typeof message.shareId === "string"
+ ) {
+ sessionManager.disconnectShareParticipants(
+ message.sessionId,
+ message.shareId,
+ {
+ reason: "The collaboration stage ended",
+ },
+ );
+ }
+});
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/control:
+ * post:
+ * summary: Grant or revoke stage control (presenter or host)
+ * description: Grants a member write access to the current stage, or revokes it with a null userId. The controller may also release control themselves.
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/control",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const { userId: targetId } = req.body ?? {};
+
+ if (targetId !== null && !isNonEmptyString(targetId)) {
+ return res
+ .status(400)
+ .json({ error: "userId must be a user id or null" });
+ }
+
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.room.stageShareId) {
+ return res.status(400).json({ error: "Nothing is being presented" });
+ }
+ if (access.room.stageProtocol !== "ssh") {
+ return res.status(400).json({
+ error: "Remote desktop stages are read-only",
+ });
+ }
+
+ const releasingOwnControl =
+ targetId === null && (await getStageController(roomId)) === userId;
+ const mayGrant = access.isHost || access.room.presenterUserId === userId;
+ if (!mayGrant && !releasingOwnControl) {
+ return res.status(403).json({
+ error: "Only the presenter or host can change stage control",
+ });
+ }
+
+ if (targetId) {
+ const repository = createCurrentCollabRoomRepository();
+ if (!(await repository.findMember(roomId, targetId))) {
+ return res.status(404).json({ error: "Member not found" });
+ }
+ }
+
+ await applyStageControl(access.room, roomId, targetId);
+ if (targetId) {
+ await collabRuntimeStore.removeRequest(roomId, targetId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_control_requests_changed",
+ roomId,
+ });
+ }
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: targetId ? "collab_control_grant" : "collab_control_revoke",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ details: JSON.stringify({ targetUserId: targetId }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ controllerUserId: targetId });
+ } catch (error) {
+ sshLogger.error("Failed to change collab stage control", error, {
+ operation: "collab_control_error",
+ });
+ res.status(500).json({ error: "Failed to change stage control" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/control/request:
+ * post:
+ * summary: Ask the presenter for stage control (hand raise)
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/control/request",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.room.stageShareId) {
+ return res.status(400).json({ error: "Nothing is being presented" });
+ }
+ if (access.room.stageProtocol !== "ssh") {
+ return res.status(400).json({
+ error: "Remote desktop stages are read-only",
+ });
+ }
+ const existing = (await collabRuntimeStore.listRequests(roomId)).find(
+ (request) => request.userId === userId,
+ );
+ if (
+ existing &&
+ Date.now() - Date.parse(existing.requestedAt) <
+ CONTROL_REQUEST_COOLDOWN_MS
+ ) {
+ return res.status(429).json({ error: "Control was already requested" });
+ }
+ const request: CollabControlRequest = {
+ userId,
+ username: await getAuditUsername(userId),
+ requestedAt: new Date().toISOString(),
+ };
+ await collabRuntimeStore.upsertRequest(roomId, request);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_control_requested",
+ roomId,
+ ...request,
+ });
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_control_request",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ request });
+ } catch (error) {
+ sshLogger.error("Failed to request collab stage control", error, {
+ operation: "collab_control_request_error",
+ });
+ res.status(500).json({ error: "Failed to request control" });
+ }
+ },
+);
+
+router.get(
+ "/rooms/:id/control/requests",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) return res.status(404).json({ error: "Room not found" });
+ if (!access.isHost && access.room.presenterUserId !== userId) {
+ return res.status(403).json({
+ error: "Only the presenter or host can review control requests",
+ });
+ }
+ res.json({ requests: await collabRuntimeStore.listRequests(roomId) });
+ } catch (error) {
+ sshLogger.error("Failed to list collab control requests", error, {
+ operation: "collab_control_requests_list_error",
+ });
+ res.status(500).json({ error: "Failed to list control requests" });
+ }
+ },
+);
+
+router.delete(
+ "/rooms/:id/control/requests/:userId",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const targetId = String(req.params.userId);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) return res.status(404).json({ error: "Room not found" });
+ const mayReview = access.isHost || access.room.presenterUserId === userId;
+ if (!mayReview && targetId !== userId) {
+ return res
+ .status(403)
+ .json({ error: "Not allowed to dismiss request" });
+ }
+ await collabRuntimeStore.removeRequest(roomId, targetId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_control_requests_changed",
+ roomId,
+ });
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action:
+ targetId === userId
+ ? "collab_control_request_cancel"
+ : "collab_control_request_dismiss",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ details: JSON.stringify({ targetUserId: targetId }),
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to dismiss collab control request", error, {
+ operation: "collab_control_request_dismiss_error",
+ });
+ res.status(500).json({ error: "Failed to dismiss control request" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/guest-link:
+ * post:
+ * summary: Enable, rotate or disable the room's anonymous guest link (host only)
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/guest-link",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ const { enabled } = req.body ?? {};
+ if (typeof enabled !== "boolean") {
+ return res.status(400).json({ error: "enabled must be a boolean" });
+ }
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.isHost) {
+ return res
+ .status(403)
+ .json({ error: "Only the host can manage the guest link" });
+ }
+ const token = enabled
+ ? crypto.randomBytes(24).toString("base64url")
+ : null;
+ await createCurrentCollabRoomRepository().setGuestToken(roomId, token);
+ if (
+ (!enabled || access.room.guestLinkToken) &&
+ access.room.stageShareId &&
+ access.room.stageProtocol === "ssh"
+ ) {
+ const share =
+ await createCurrentSessionShareRepository().findActiveById(
+ access.room.stageShareId,
+ );
+ if (share) {
+ sessionManager.disconnectShareParticipants(
+ share.sessionId,
+ share.id,
+ {
+ userId: null,
+ reason: enabled
+ ? "The guest link was rotated"
+ : "The guest link was disabled",
+ },
+ );
+ }
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: enabled
+ ? "collab_guest_link_enable"
+ : "collab_guest_link_disable",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ guestLinkToken: token });
+ } catch (error) {
+ sshLogger.error("Failed to update collab guest link", error, {
+ operation: "collab_guest_link_error",
+ });
+ res.status(500).json({ error: "Failed to update guest link" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/guest/{token}:
+ * get:
+ * summary: Resolve a room's current stage for an anonymous guest
+ * description: Public, rate-limited per IP. Guests poll this to follow presenter switches. Never returns host details; SSH stages are joined over the terminal WS with roomGuestToken, guac stages get a read-only join token.
+ * tags:
+ * - Collab
+ */
+router.get("/guest/:token", async (req: Request, res: Response) => {
+ const ip = req.ip || req.socket.remoteAddress || "unknown";
+ if (isCollabGuestRateLimited(ip)) {
+ return res.status(429).json({ error: "Too many requests" });
+ }
+ const token = String(req.params.token);
+ try {
+ const room =
+ await createCurrentCollabRoomRepository().findByGuestToken(token);
+ if (!room) {
+ return res.status(404).json({ error: "Link not found" });
+ }
+ const response: Record = {
+ roomName: room.name,
+ stage: null,
+ };
+ if (room.stageShareId && room.stageProtocol) {
+ const share = await createCurrentSessionShareRepository().findActiveById(
+ room.stageShareId,
+ );
+ const protocol = room.stageProtocol as LiveProtocol;
+ if (share && isLiveSession(protocol, share.sessionId)) {
+ const { enabled } = await isSharingEnabledForHost(share.hostId);
+ if (enabled) {
+ response.stage = {
+ protocol,
+ shareId: share.id,
+ ...(protocol === "ssh"
+ ? {
+ wsPath: `/terminal/ws?roomGuestToken=${encodeURIComponent(token)}`,
+ }
+ : {
+ connectParams: {
+ token: tokenService.createJoinToken(share.sessionId, true),
+ },
+ }),
+ };
+ }
+ }
+ }
+ res.json(response);
+ } catch (error) {
+ sshLogger.error("Failed to resolve collab guest link", error, {
+ operation: "collab_guest_resolve_error",
+ });
+ res.status(500).json({ error: "Failed to resolve guest link" });
+ }
+});
+
+/**
+ * @openapi
+ * /collab/rooms/{id}/end:
+ * post:
+ * summary: End the meeting (host only)
+ * description: Clears the stage. One-off rooms are ended for good; persistent rooms stay listed for reuse.
+ * tags:
+ * - Collab
+ */
+router.post(
+ "/rooms/:id/end",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.isHost) {
+ return res
+ .status(403)
+ .json({ error: "Only the host can end the room" });
+ }
+
+ await revokeStageShare(access.room);
+ await setStageController(roomId, null);
+ await collabRuntimeStore.clearRequests(roomId);
+ const repository = createCurrentCollabRoomRepository();
+ if (access.room.persistent) {
+ await repository.setGuestToken(roomId, null);
+ await repository.clearStage(roomId);
+ collabRoomHub.broadcast(roomId, {
+ type: "collab_stage_changed",
+ roomId,
+ stage: null,
+ });
+ } else {
+ await repository.endRoom(roomId);
+ collabRoomHub.broadcast(roomId, { type: "collab_room_ended", roomId });
+ }
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_end",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to end collab room", error, {
+ operation: "collab_room_end_error",
+ });
+ res.status(500).json({ error: "Failed to end room" });
+ }
+ },
+);
+
+/**
+ * @openapi
+ * /collab/rooms/{id}:
+ * delete:
+ * summary: Permanently delete a room (host only)
+ * description: Revokes the active stage and removes the room and its membership. This cannot be undone.
+ * tags:
+ * - Collab
+ */
+router.delete(
+ "/rooms/:id",
+ authenticateJWT,
+ async (req: Request, res: Response) => {
+ const userId = (req as AuthenticatedRequest).userId!;
+ const roomId = String(req.params.id);
+ try {
+ const access = await requireRoomMember(roomId, userId);
+ if (!access) {
+ return res.status(404).json({ error: "Room not found" });
+ }
+ if (!access.isHost) {
+ return res
+ .status(403)
+ .json({ error: "Only the host can delete the room" });
+ }
+
+ await revokeStageShare(access.room);
+ await setStageController(roomId, null);
+ await collabRuntimeStore.clearRequests(roomId);
+ collabRoomHub.broadcast(roomId, { type: "collab_room_ended", roomId });
+ await createCurrentCollabRoomRepository().deleteRoom(roomId);
+
+ const { ipAddress, userAgent } = getRequestMeta(req);
+ await logAudit({
+ userId,
+ username: await getAuditUsername(userId),
+ action: "collab_room_delete",
+ resourceType: "collab_room",
+ resourceId: roomId,
+ resourceName: access.room.name,
+ ipAddress,
+ userAgent,
+ success: true,
+ });
+ res.json({ success: true });
+ } catch (error) {
+ sshLogger.error("Failed to delete collab room", error, {
+ operation: "collab_room_delete_error",
+ });
+ res.status(500).json({ error: "Failed to delete room" });
+ }
+ },
+);
+
+export default router;
diff --git a/src/backend/hosts/collab/runtime-store.ts b/src/backend/hosts/collab/runtime-store.ts
new file mode 100644
index 000000000..51b98be53
--- /dev/null
+++ b/src/backend/hosts/collab/runtime-store.ts
@@ -0,0 +1,286 @@
+import crypto from "crypto";
+import { createClient } from "redis";
+import { sshLogger } from "../../utils/logger.js";
+
+export interface CollabControlRequest {
+ userId: string;
+ username: string;
+ requestedAt: string;
+}
+
+interface PresenceEntry {
+ instanceId: string;
+ userId: string;
+ username: string;
+}
+
+interface EventEnvelope {
+ source: string;
+ roomId: string;
+ message: object;
+}
+
+const KEY_PREFIX = process.env.TERMIX_REDIS_PREFIX?.trim() || "termix:collab";
+const EVENT_CHANNEL = `${KEY_PREFIX}:events`;
+const PRESENCE_TTL_MS = 45_000;
+const STATE_TTL_SECONDS = 12 * 60 * 60;
+const CONNECT_RETRY_MS = 15_000;
+
+export class CollabRuntimeStore {
+ private readonly instanceId = crypto.randomUUID();
+ private publisher: ReturnType | null = null;
+ private subscriber: ReturnType | null = null;
+ private connecting: Promise | null = null;
+ private nextConnectAttempt = 0;
+ private eventListeners = new Set<(roomId: string, message: object) => void>();
+ private localControllers = new Map();
+ private localRequests = new Map>();
+ private presenceMembers = new Map>();
+
+ onEvent(listener: (roomId: string, message: object) => void): void {
+ this.eventListeners.add(listener);
+ void this.ensureConnected();
+ }
+
+ async publish(roomId: string, message: object): Promise {
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ await this.publisher
+ .publish(
+ EVENT_CHANNEL,
+ JSON.stringify({ source: this.instanceId, roomId, message }),
+ )
+ .catch((error) => this.logRedisFailure("publish", error));
+ }
+
+ async getController(roomId: string): Promise {
+ if (await this.ensureConnected()) {
+ const value = await this.publisher
+ ?.get(`${KEY_PREFIX}:controller:${roomId}`)
+ .catch((error) => {
+ this.logRedisFailure("get_controller", error);
+ return undefined;
+ });
+ if (value !== undefined) return value;
+ }
+ return this.localControllers.get(roomId) ?? null;
+ }
+
+ async setController(roomId: string, userId: string | null): Promise {
+ if (userId) this.localControllers.set(roomId, userId);
+ else this.localControllers.delete(roomId);
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ const key = `${KEY_PREFIX}:controller:${roomId}`;
+ const operation = userId
+ ? this.publisher.set(key, userId, { EX: STATE_TTL_SECONDS })
+ : this.publisher.del(key);
+ await operation.catch((error) =>
+ this.logRedisFailure("set_controller", error),
+ );
+ }
+
+ async listRequests(roomId: string): Promise {
+ if (await this.ensureConnected()) {
+ const values = await this.publisher
+ ?.hVals(`${KEY_PREFIX}:requests:${roomId}`)
+ .catch((error) => {
+ this.logRedisFailure("list_requests", error);
+ return null;
+ });
+ if (values) {
+ return values
+ .flatMap((value) => this.parse(value) ?? [])
+ .sort((a, b) => a.requestedAt.localeCompare(b.requestedAt));
+ }
+ }
+ return Array.from(this.localRequests.get(roomId)?.values() ?? []).sort(
+ (a, b) => a.requestedAt.localeCompare(b.requestedAt),
+ );
+ }
+
+ async upsertRequest(
+ roomId: string,
+ request: CollabControlRequest,
+ ): Promise {
+ let requests = this.localRequests.get(roomId);
+ if (!requests) {
+ requests = new Map();
+ this.localRequests.set(roomId, requests);
+ }
+ requests.set(request.userId, request);
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ const key = `${KEY_PREFIX}:requests:${roomId}`;
+ await this.publisher
+ .multi()
+ .hSet(key, request.userId, JSON.stringify(request))
+ .expire(key, STATE_TTL_SECONDS)
+ .exec()
+ .catch((error) => this.logRedisFailure("upsert_request", error));
+ }
+
+ async removeRequest(roomId: string, userId: string): Promise {
+ const requests = this.localRequests.get(roomId);
+ requests?.delete(userId);
+ if (requests?.size === 0) this.localRequests.delete(roomId);
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ await this.publisher
+ .hDel(`${KEY_PREFIX}:requests:${roomId}`, userId)
+ .catch((error) => this.logRedisFailure("remove_request", error));
+ }
+
+ async clearRequests(roomId: string): Promise {
+ this.localRequests.delete(roomId);
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ await this.publisher
+ .del(`${KEY_PREFIX}:requests:${roomId}`)
+ .catch((error) => this.logRedisFailure("clear_requests", error));
+ }
+
+ async updatePresence(
+ roomId: string,
+ users: Array<{ userId: string; username: string }>,
+ ): Promise {
+ if (!(await this.ensureConnected()) || !this.publisher) return;
+ const key = `${KEY_PREFIX}:presence:${roomId}`;
+ const previous = this.presenceMembers.get(roomId) ?? new Set();
+ const expiresAt = Date.now() + PRESENCE_TTL_MS;
+ const current = new Set(
+ users.map((user) =>
+ JSON.stringify({
+ instanceId: this.instanceId,
+ ...user,
+ } satisfies PresenceEntry),
+ ),
+ );
+ const transaction = this.publisher.multi();
+ if (previous.size > 0) transaction.zRem(key, Array.from(previous));
+ for (const member of current) {
+ transaction.zAdd(key, { score: expiresAt, value: member });
+ }
+ transaction.expire(key, Math.ceil(PRESENCE_TTL_MS / 1000) * 2);
+ await transaction
+ .exec()
+ .then(() => {
+ if (current.size > 0) this.presenceMembers.set(roomId, current);
+ else this.presenceMembers.delete(roomId);
+ })
+ .catch((error) => this.logRedisFailure("update_presence", error));
+ }
+
+ async onlineUsers(
+ roomId: string,
+ localUsers: Array<{ userId: string; username: string }>,
+ ): Promise> {
+ if (!(await this.ensureConnected()) || !this.publisher) return localUsers;
+ const key = `${KEY_PREFIX}:presence:${roomId}`;
+ const now = Date.now();
+ const transaction = this.publisher
+ .multi()
+ .zRemRangeByScore(key, 0, now)
+ .zRangeByScore(key, now + 1, "+inf");
+ const result = await transaction.exec().catch((error) => {
+ this.logRedisFailure("online_users", error);
+ return null;
+ });
+ const members = result?.[1] as string[] | undefined;
+ if (!members) return localUsers;
+ const seen = new Map();
+ for (const member of members) {
+ const entry = this.parse(member);
+ if (entry) seen.set(entry.userId, entry.username);
+ }
+ return Array.from(seen, ([userId, username]) => ({ userId, username }));
+ }
+
+ async close(): Promise {
+ await Promise.allSettled([
+ this.publisher?.isOpen ? this.publisher.quit() : Promise.resolve(),
+ this.subscriber?.isOpen ? this.subscriber.quit() : Promise.resolve(),
+ ]);
+ this.publisher = null;
+ this.subscriber = null;
+ }
+
+ private async ensureConnected(): Promise {
+ const url = process.env.REDIS_URL?.trim();
+ if (!url) return false;
+ if (this.publisher?.isReady && this.subscriber?.isReady) return true;
+ if (Date.now() < this.nextConnectAttempt) return false;
+ if (this.connecting) return this.connecting;
+ this.connecting = this.connect(url).finally(() => {
+ this.connecting = null;
+ });
+ return this.connecting;
+ }
+
+ private async connect(url: string): Promise {
+ try {
+ this.publisher = createClient({
+ url,
+ socket: { connectTimeout: 1500, reconnectStrategy: false },
+ });
+ this.subscriber = this.publisher.duplicate();
+ this.publisher.on("error", (error) =>
+ this.logRedisFailure("client", error),
+ );
+ this.subscriber.on("error", (error) =>
+ this.logRedisFailure("subscriber", error),
+ );
+ await Promise.all([this.publisher.connect(), this.subscriber.connect()]);
+ await this.subscriber.subscribe(EVENT_CHANNEL, (raw) => {
+ const envelope = this.parse(raw);
+ if (
+ !envelope ||
+ typeof envelope.source !== "string" ||
+ typeof envelope.roomId !== "string" ||
+ !envelope.message ||
+ typeof envelope.message !== "object" ||
+ envelope.source === this.instanceId
+ ) {
+ return;
+ }
+ for (const listener of this.eventListeners) {
+ try {
+ listener(envelope.roomId, envelope.message);
+ } catch (error) {
+ this.logRedisFailure("event_listener", error);
+ }
+ }
+ });
+ sshLogger.info("Collaboration Redis runtime connected", {
+ operation: "collab_redis_connected",
+ });
+ this.nextConnectAttempt = 0;
+ return true;
+ } catch (error) {
+ this.nextConnectAttempt = Date.now() + CONNECT_RETRY_MS;
+ this.logRedisFailure("connect", error);
+ await Promise.allSettled([
+ this.publisher?.disconnect(),
+ this.subscriber?.disconnect(),
+ ]);
+ this.publisher = null;
+ this.subscriber = null;
+ return false;
+ }
+ }
+
+ private parse(value: string): T | null {
+ try {
+ return JSON.parse(value) as T;
+ } catch {
+ return null;
+ }
+ }
+
+ private logRedisFailure(operation: string, error: unknown): void {
+ sshLogger.warn(
+ "Collaboration Redis runtime unavailable; using local state",
+ {
+ operation: `collab_redis_${operation}`,
+ error: error instanceof Error ? error.message : String(error),
+ },
+ );
+ }
+}
+
+export const collabRuntimeStore = new CollabRuntimeStore();
diff --git a/src/backend/hosts/collab/stage-control.ts b/src/backend/hosts/collab/stage-control.ts
new file mode 100644
index 000000000..5961cf6ac
--- /dev/null
+++ b/src/backend/hosts/collab/stage-control.ts
@@ -0,0 +1,18 @@
+/**
+ * Who besides the presenter may drive the current stage, per room.
+ *
+ * Redis-backed when REDIS_URL is configured, with a local fallback for
+ * single-instance deployments. Every stage switch clears it.
+ */
+import { collabRuntimeStore } from "./runtime-store.js";
+
+export function getStageController(roomId: string): Promise {
+ return collabRuntimeStore.getController(roomId);
+}
+
+export function setStageController(
+ roomId: string,
+ userId: string | null,
+): Promise {
+ return collabRuntimeStore.setController(roomId, userId);
+}
diff --git a/src/backend/hosts/docker/console.ts b/src/backend/hosts/docker/console.ts
index d1088e6f8..fdd65b3de 100644
--- a/src/backend/hosts/docker/console.ts
+++ b/src/backend/hosts/docker/console.ts
@@ -18,7 +18,15 @@ import {
hostAddressMismatch,
HOST_ADDRESS_MISMATCH_MESSAGE,
HOST_NOT_ON_THIS_SERVER_MESSAGE,
-} from "../terminal/host-identity.js";
+} from "../host-identity.js";
+import { extractWebSocketToken } from "../../utils/ws-auth.js";
+import {
+ asObject,
+ asString,
+ MAX_WS_MESSAGE_BYTES,
+ parseWsMessage,
+ toTerminalDimension,
+} from "../../utils/ws-message.js";
const sshLogger = systemLogger;
@@ -35,8 +43,9 @@ interface SSHSession {
const activeSessions = new Map();
const wss = new WebSocketServer({
- host: "0.0.0.0",
+ host: "127.0.0.1",
port: 30009,
+ maxPayload: MAX_WS_MESSAGE_BYTES,
});
wss.on("error", (error) => {
@@ -285,26 +294,7 @@ async function createJumpHostChain(
}
wss.on("connection", async (ws: WebSocket, req) => {
- let token: string | undefined;
-
- const cookieHeader = req.headers.cookie;
- if (cookieHeader) {
- const match = cookieHeader.match(/(?:^|;\s*)jwt=([^;]+)/);
- if (match) token = decodeURIComponent(match[1]);
- }
-
- if (!token) {
- const authHeader = req.headers.authorization;
- if (authHeader?.startsWith("Bearer ")) {
- token = authHeader.slice("Bearer ".length);
- }
- }
-
- if (!token) {
- const urlObj = new URL(req.url || "", "http://localhost");
- const qp = urlObj.searchParams.get("token");
- if (qp) token = qp;
- }
+ const token = extractWebSocketToken(req);
if (!token) {
ws.close(1008, "Authentication required");
@@ -312,7 +302,17 @@ wss.on("connection", async (ws: WebSocket, req) => {
}
const authManagerInstance = AuthManager.getInstance();
- const payload = await authManagerInstance.verifyJWTToken(token);
+ let payload;
+ try {
+ payload = await authManagerInstance.verifyJWTToken(token);
+ } catch (error) {
+ sshLogger.warn("Docker console JWT verification failed", {
+ operation: "docker_console_auth_error",
+ error: getErrorMessage(error),
+ });
+ ws.close(1008, "Authentication required");
+ return;
+ }
if (!payload?.userId || payload.pendingTOTP) {
ws.close(1008, "Authentication required");
return;
@@ -334,20 +334,29 @@ wss.on("connection", async (ws: WebSocket, req) => {
}
}, 30000);
+ const cleanup = () => {
+ clearInterval(wsPingInterval);
+ if (!sshSession) return;
+ sshSession.stream?.end();
+ sshSession.client.end();
+ activeSessions.delete(sessionId);
+ sshSession = null;
+ };
+
ws.on("message", async (data) => {
try {
- const message = JSON.parse(data.toString());
+ const message = parseWsMessage(data);
switch (message.type) {
case "connect": {
- const { hostConfig, containerId, shell, cols, rows } =
- message.data as {
- hostConfig: SSHHost;
- containerId: string;
- shell?: string;
- cols?: number;
- rows?: number;
- };
+ const connectData = asObject(message.data);
+ const hostConfig = asObject(
+ connectData.hostConfig,
+ ) as unknown as SSHHost;
+ const containerId = asString(connectData.containerId);
+ const shell = asString(connectData.shell) || undefined;
+ const cols = toTerminalDimension(connectData.cols) || 80;
+ const rows = toTerminalDimension(connectData.rows) || 24;
const hostId = hostConfig?.id;
@@ -613,8 +622,8 @@ wss.on("connection", async (ws: WebSocket, req) => {
{
pty: {
term: "xterm-256color",
- cols: cols || 80,
- rows: rows || 24,
+ cols,
+ rows,
},
},
(err, stream) => {
@@ -712,7 +721,7 @@ wss.on("connection", async (ws: WebSocket, req) => {
sshLogger.error("Failed to connect to container", error, {
operation: "console_connect",
sessionId,
- containerId: message.data.containerId,
+ containerId,
});
ws.send(
@@ -730,15 +739,19 @@ wss.on("connection", async (ws: WebSocket, req) => {
case "input": {
if (sshSession && sshSession.stream) {
- sshSession.stream.write(message.data);
+ const input = asString(message.data);
+ if (input) sshSession.stream.write(input);
}
break;
}
case "resize": {
if (sshSession && sshSession.stream) {
- const { cols, rows } = message.data;
- sshSession.stream.setWindow(rows, cols, rows, cols);
+ const dimensions = asObject(message.data);
+ const cols = toTerminalDimension(dimensions.cols);
+ const rows = toTerminalDimension(dimensions.rows);
+ if (cols && rows)
+ sshSession.stream.setWindow(rows, cols, rows, cols);
}
break;
}
@@ -790,7 +803,6 @@ wss.on("connection", async (ws: WebSocket, req) => {
});
ws.on("close", () => {
- clearInterval(wsPingInterval);
sshLogger.info("Docker console disconnected", {
operation: "docker_console_disconnect",
sessionId,
@@ -798,13 +810,7 @@ wss.on("connection", async (ws: WebSocket, req) => {
hostId: sshSession?.hostId,
containerId: sshSession?.containerId,
});
- if (sshSession) {
- if (sshSession.stream) {
- sshSession.stream.end();
- }
- sshSession.client.end();
- activeSessions.delete(sessionId);
- }
+ cleanup();
});
ws.on("error", (error) => {
@@ -813,13 +819,7 @@ wss.on("connection", async (ws: WebSocket, req) => {
sessionId,
});
- if (sshSession) {
- if (sshSession.stream) {
- sshSession.stream.end();
- }
- sshSession.client.end();
- activeSessions.delete(sessionId);
- }
+ cleanup();
});
});
diff --git a/src/backend/hosts/docker/index.ts b/src/backend/hosts/docker/index.ts
index 9619825b2..d06d13786 100644
--- a/src/backend/hosts/docker/index.ts
+++ b/src/backend/hosts/docker/index.ts
@@ -16,15 +16,19 @@ import {
getRequestUserId,
registerDockerSshRoutes,
} from "./routes.js";
+import { listenOnServicePort } from "../../utils/service-listen.js";
const sshLogger = logger;
const app = express();
+app.set("trust proxy", "loopback");
app.use(createCompressionMiddleware());
app.use(createCorsMiddleware(["GET", "POST", "PUT", "DELETE", "OPTIONS"]));
app.use(cookieParser());
+const authManager = AuthManager.getInstance();
+app.use(authManager.createAuthMiddleware());
app.use(express.json({ limit: "100mb" }));
app.use(express.urlencoded({ limit: "100mb", extended: true }));
app.use((_req, res, next) => {
@@ -32,9 +36,6 @@ app.use((_req, res, next) => {
next();
});
-const authManager = AuthManager.getInstance();
-app.use(authManager.createAuthMiddleware());
-
registerDockerSshRoutes(app);
registerDockerContainerRoutes(app, {
@@ -47,14 +48,20 @@ registerDockerContainerRoutes(app, {
const PORT = 30007;
-app.listen(PORT, async () => {
- try {
- await authManager.initialize();
- } catch (err) {
- sshLogger.error("Failed to initialize Docker backend", err, {
- operation: "startup",
- });
- }
+listenOnServicePort({
+ app,
+ port: PORT,
+ logger: sshLogger,
+ serviceName: "docker",
+ onListening: async () => {
+ try {
+ await authManager.initialize();
+ } catch (err) {
+ sshLogger.error("Failed to initialize Docker backend", err, {
+ operation: "startup",
+ });
+ }
+ },
});
process.on("SIGINT", () => {
diff --git a/src/backend/hosts/docker/routes.ts b/src/backend/hosts/docker/routes.ts
index 78149f84f..3c36ed6c9 100644
--- a/src/backend/hosts/docker/routes.ts
+++ b/src/backend/hosts/docker/routes.ts
@@ -1,4 +1,5 @@
import { getErrorMessage } from "../../utils/error-message.js";
+import { usesIssuedCertificate } from "../issued-certificate-auth.js";
import express from "express";
import axios from "axios";
import { Client as SSHClient } from "ssh2";
@@ -300,7 +301,7 @@ export function registerDockerSshRoutes(app: express.Express): void {
if (resolvedCredentials.password) {
config.password = resolvedCredentials.password;
}
- } else if (resolvedCredentials.authType === "opkssh") {
+ } else if (usesIssuedCertificate(resolvedCredentials.authType)) {
try {
const { getOPKSSHToken } = await import("../opkssh-auth.js");
const token = await getOPKSSHToken(userId, hostId);
diff --git a/src/backend/hosts/external-secrets.ts b/src/backend/hosts/external-secrets.ts
new file mode 100644
index 000000000..aeb9b5b92
--- /dev/null
+++ b/src/backend/hosts/external-secrets.ts
@@ -0,0 +1,110 @@
+import { createCurrentSecretSourceRepository } from "../database/repositories/factory.js";
+import type { SecretSourceRecord } from "../database/repositories/secret-source-repository.js";
+import {
+ isSecretReference,
+ parseSecretReference,
+ resolveConnectReference,
+} from "../utils/onepassword-connect.js";
+import { readSecretSourcePrivateAllowlist } from "../utils/secret-source-egress.js";
+
+/**
+ * Expands "op://vault/item/field" references in a resolved host's secret
+ * fields into the actual secrets, fetched from the user's secret source.
+ *
+ * Runs once per host resolution, at the single point where every subsystem
+ * gets its plaintext credentials - so terminal, SFTP, Docker, metrics and
+ * tunnels all see real secrets without knowing references exist.
+ *
+ * Host resolution is hot (status polls, fleets), so resolved values are
+ * cached briefly in memory; a rotated secret shows up within CACHE_TTL_MS.
+ */
+
+export const SECRET_FIELDS = [
+ "password",
+ "key",
+ "keyPassword",
+ "sudoPassword",
+ "socks5Password",
+ "rdpPassword",
+ "vncPassword",
+ "telnetPassword",
+] as const;
+
+const CACHE_TTL_MS = 60_000;
+const cache = new Map();
+
+/** Test seam. */
+export function clearExternalSecretCache(): void {
+ cache.clear();
+}
+
+export type SecretResolver = (
+ source: SecretSourceRecord,
+ reference: string,
+) => Promise;
+
+async function defaultResolver(
+ source: SecretSourceRecord,
+ reference: string,
+): Promise {
+ const ref = parseSecretReference(reference);
+ if (!ref) throw new Error(`Invalid secret reference: ${reference}`);
+ const repository = createCurrentSecretSourceRepository();
+ return resolveConnectReference(
+ {
+ baseUrl: source.baseUrl,
+ token: repository.decryptToken(source),
+ allowedPrivateHosts: await readSecretSourcePrivateAllowlist(),
+ },
+ ref,
+ );
+}
+
+/** The user's own source first, else a shared one. */
+export async function pickSecretSource(
+ userId: string,
+): Promise {
+ const sources =
+ await createCurrentSecretSourceRepository().listVisibleToUser(userId);
+ return (
+ sources.find((source) => source.userId === userId) ?? sources[0] ?? null
+ );
+}
+
+export async function resolveSecretReference(
+ userId: string,
+ reference: string,
+ deps: {
+ resolver?: SecretResolver;
+ pickSource?: (userId: string) => Promise;
+ now?: () => number;
+ } = {},
+): Promise {
+ const now = deps.now ?? Date.now;
+ const source = await (deps.pickSource ?? pickSecretSource)(userId);
+ if (!source) {
+ throw new Error(
+ "This host uses a secret reference but no secret source is configured",
+ );
+ }
+ const cacheKey = `${source.id}:${reference.trim()}`;
+ const cached = cache.get(cacheKey);
+ if (cached && cached.expiresAt > now()) return cached.value;
+
+ const value = await (deps.resolver ?? defaultResolver)(source, reference);
+ cache.set(cacheKey, { value, expiresAt: now() + CACHE_TTL_MS });
+ return value;
+}
+
+/** Replaces every reference in the host's secret fields, in place. */
+export async function resolveExternalSecretRefs(
+ host: Record,
+ userId: string,
+ deps?: Parameters[2],
+): Promise {
+ for (const field of SECRET_FIELDS) {
+ const value = host[field];
+ if (!isSecretReference(value)) continue;
+ host[field] = await resolveSecretReference(userId, value, deps);
+ }
+}
diff --git a/src/backend/hosts/file-manager/content-routes.ts b/src/backend/hosts/file-manager/content-routes.ts
index bda93e685..dc226fac2 100644
--- a/src/backend/hosts/file-manager/content-routes.ts
+++ b/src/backend/hosts/file-manager/content-routes.ts
@@ -3,6 +3,7 @@ import Busboy from "busboy";
import type { AuthenticatedRequest } from "../../../types/index.js";
import { fileLogger } from "../../utils/logger.js";
import {
+ execBuffer,
execChannel,
execWithSudo,
execWithSudoBuffer,
@@ -64,7 +65,7 @@ export function registerFileContentRoutes(
app.get("/ssh/file_manager/ssh/identifySymlink", (req, res) => {
const sessionId = req.query.sessionId as string;
const sshConn = sshSessions[sessionId];
- const linkPath = decodeURIComponent(req.query.path as string);
+ const linkPath = req.query.path as string;
const userId = (req as AuthenticatedRequest).userId;
if (!sessionId) {
@@ -165,7 +166,7 @@ export function registerFileContentRoutes(
app.get("/ssh/file_manager/ssh/resolvePath", (req, res) => {
const sessionId = req.query.sessionId as string;
const sshConn = sshSessions[sessionId];
- const rawPath = decodeURIComponent(req.query.path as string);
+ const rawPath = req.query.path as string;
const userId = (req as AuthenticatedRequest).userId;
if (!sessionId) {
@@ -262,10 +263,10 @@ export function registerFileContentRoutes(
* 500:
* description: Failed to read file.
*/
- app.get("/ssh/file_manager/ssh/readFile", (req, res) => {
+ app.get("/ssh/file_manager/ssh/readFile", async (req, res) => {
const sessionId = req.query.sessionId as string;
const sshConn = sshSessions[sessionId];
- const filePath = decodeURIComponent(req.query.path as string);
+ const filePath = req.query.path as string;
const userId = (req as AuthenticatedRequest).userId;
if (!sessionId) {
@@ -295,166 +296,133 @@ export function registerFileContentRoutes(
const MAX_READ_SIZE = 500 * 1024 * 1024;
const escapedPath = filePath.replace(/'/g, "'\"'\"'");
- execChannel(
- sshConn,
- `stat -c%s '${escapedPath}' 2>/dev/null || wc -c < '${escapedPath}'`,
- (sizeErr, sizeStream) => {
- if (sizeErr) {
- fileLogger.error("SSH file size check error:", sizeErr);
- return res.status(500).json({ error: sizeErr.message });
- }
+ const isPermissionDenied = (message: string) =>
+ message.toLowerCase().includes("permission denied");
+ const isFileNotFound = (message: string) => {
+ const lower = message.toLowerCase();
+ return (
+ lower.includes("no such file or directory") ||
+ lower.includes("cannot access") ||
+ lower.includes("not found") ||
+ lower.includes("resource not found")
+ );
+ };
- let sizeData = "";
- let sizeErrorData = "";
+ try {
+ let sizeResult = await execBuffer(
+ sshConn,
+ `stat -c%s '${escapedPath}' 2>/dev/null || wc -c < '${escapedPath}'`,
+ );
+ let sizeError = sizeResult.stderr || sizeResult.stdout.toString("utf8");
- sizeStream.on("data", (chunk: Buffer) => {
- sizeData += chunk.toString();
+ if (
+ sizeResult.code !== 0 &&
+ isPermissionDenied(sizeError) &&
+ sshConn.sudoPassword
+ ) {
+ sizeResult = await execWithSudoBuffer(
+ sshConn,
+ `stat -c%s '${escapedPath}'`,
+ sshConn.sudoPassword,
+ );
+ sizeError = sizeResult.stderr || sizeResult.stdout.toString("utf8");
+ }
+
+ if (sizeResult.code !== 0) {
+ const missing = isFileNotFound(sizeError);
+ const permissionDenied = isPermissionDenied(sizeError);
+ fileLogger.error(`File size check failed: ${sizeError}`);
+ return res.status(missing ? 404 : permissionDenied ? 403 : 500).json({
+ error: `Cannot check file size: ${sizeError}`,
+ fileNotFound: missing,
+ needsSudo: permissionDenied,
});
+ }
- sizeStream.stderr.on("data", (chunk: Buffer) => {
- sizeErrorData += chunk.toString();
+ const fileSize = parseInt(sizeResult.stdout.toString("utf8").trim(), 10);
+ if (isNaN(fileSize)) {
+ fileLogger.error("Invalid file size response:", sizeResult.stdout);
+ return res.status(500).json({ error: "Cannot determine file size" });
+ }
+
+ if (fileSize > MAX_READ_SIZE) {
+ fileLogger.warn("File too large for reading", {
+ operation: "file_read",
+ sessionId,
+ filePath,
+ fileSize,
+ maxSize: MAX_READ_SIZE,
});
-
- sizeStream.on("close", (sizeCode) => {
- if (sizeCode !== 0) {
- const errorLower = sizeErrorData.toLowerCase();
- const isFileNotFound =
- errorLower.includes("no such file or directory") ||
- errorLower.includes("cannot access") ||
- errorLower.includes("not found") ||
- errorLower.includes("resource not found");
-
- fileLogger.error(`File size check failed: ${sizeErrorData}`);
- return res.status(isFileNotFound ? 404 : 500).json({
- error: `Cannot check file size: ${sizeErrorData}`,
- fileNotFound: isFileNotFound,
- });
- }
-
- const fileSize = parseInt(sizeData.trim(), 10);
-
- if (isNaN(fileSize)) {
- fileLogger.error("Invalid file size response:", sizeData);
- return res
- .status(500)
- .json({ error: "Cannot determine file size" });
- }
-
- if (fileSize > MAX_READ_SIZE) {
- fileLogger.warn("File too large for reading", {
- operation: "file_read",
- sessionId,
- filePath,
- fileSize,
- maxSize: MAX_READ_SIZE,
- });
- return res.status(400).json({
- error: `File too large to open in editor. Maximum size is ${MAX_READ_SIZE / 1024 / 1024}MB, file is ${(fileSize / 1024 / 1024).toFixed(2)}MB. Use download instead.`,
- fileSize,
- maxSize: MAX_READ_SIZE,
- tooLarge: true,
- });
- }
-
- execChannel(sshConn, `cat '${escapedPath}'`, (err, stream) => {
- if (err) {
- fileLogger.error("SSH readFile error:", err);
- return res.status(500).json({ error: err.message });
- }
-
- let binaryData = Buffer.alloc(0);
- let errorData = "";
-
- stream.on("data", (chunk: Buffer) => {
- binaryData = Buffer.concat([binaryData, chunk]);
- });
-
- stream.stderr.on("data", (chunk: Buffer) => {
- errorData += chunk.toString();
- });
-
- stream.on("close", (code) => {
- if (code !== 0) {
- const isPermissionDenied = errorData
- .toLowerCase()
- .includes("permission denied");
-
- if (isPermissionDenied && sshConn.sudoPassword) {
- execWithSudoBuffer(
- sshConn,
- `cat '${escapedPath}'`,
- sshConn.sudoPassword,
- )
- .then((result) => {
- if (result.code !== 0) {
- return res.status(403).json({
- error: `Permission denied: ${result.stderr || result.stdout.toString("utf8")}`,
- needsSudo: true,
- });
- }
-
- const sudoData = result.stdout;
- const isBinary = detectBinary(sudoData);
- res.json({
- content: isBinary
- ? sudoData.toString("base64")
- : sudoData.toString("utf8"),
- isBinary,
- size: sudoData.length,
- });
- })
- .catch(() => {
- res
- .status(403)
- .json({ error: "Permission denied", needsSudo: true });
- });
- return;
- }
-
- fileLogger.error(
- `SSH readFile command failed with code ${code}: ${errorData.replace(/\n/g, " ").trim()}`,
- );
-
- const isFileNotFound =
- errorData.includes("No such file or directory") ||
- errorData.includes("cannot access") ||
- errorData.includes("not found");
-
- return res.status(isFileNotFound ? 404 : 500).json({
- error: `Command failed: ${errorData}`,
- fileNotFound: isFileNotFound,
- });
- }
-
- const isBinary = detectBinary(binaryData);
- fileLogger.success("File read successfully", {
- operation: "file_read_success",
- sessionId,
- userId,
- path: filePath,
- bytes: binaryData.length,
- });
-
- if (isBinary) {
- const base64Content = binaryData.toString("base64");
- res.json({
- content: base64Content,
- path: filePath,
- encoding: "base64",
- });
- } else {
- const textContent = binaryData.toString("utf8");
- res.json({
- content: textContent,
- path: filePath,
- encoding: "utf8",
- });
- }
- });
- });
+ return res.status(400).json({
+ error: `File too large to open in editor. Maximum size is ${MAX_READ_SIZE / 1024 / 1024}MB, file is ${(fileSize / 1024 / 1024).toFixed(2)}MB. Use download instead.`,
+ fileSize,
+ maxSize: MAX_READ_SIZE,
+ tooLarge: true,
});
- },
- );
+ }
+
+ let contentResult = await execBuffer(
+ sshConn,
+ `cat '${escapedPath}'`,
+ MAX_READ_SIZE,
+ );
+ let contentError =
+ contentResult.stderr || contentResult.stdout.toString("utf8");
+
+ if (
+ contentResult.code !== 0 &&
+ isPermissionDenied(contentError) &&
+ sshConn.sudoPassword
+ ) {
+ contentResult = await execWithSudoBuffer(
+ sshConn,
+ `cat '${escapedPath}'`,
+ sshConn.sudoPassword,
+ MAX_READ_SIZE,
+ );
+ contentError =
+ contentResult.stderr || contentResult.stdout.toString("utf8");
+ }
+
+ if (contentResult.exceededLimit) {
+ return res.status(400).json({
+ error: `File grew beyond the ${MAX_READ_SIZE / 1024 / 1024}MB read limit`,
+ maxSize: MAX_READ_SIZE,
+ tooLarge: true,
+ });
+ }
+
+ if (contentResult.code !== 0) {
+ const missing = isFileNotFound(contentError);
+ const permissionDenied = isPermissionDenied(contentError);
+ fileLogger.error(
+ `SSH readFile command failed with code ${contentResult.code}: ${contentError.replace(/\n/g, " ").trim()}`,
+ );
+ return res.status(missing ? 404 : permissionDenied ? 403 : 500).json({
+ error: `Command failed: ${contentError}`,
+ fileNotFound: missing,
+ needsSudo: permissionDenied,
+ });
+ }
+
+ const isBinary = detectBinary(contentResult.stdout);
+ fileLogger.success("File read successfully", {
+ operation: "file_read_success",
+ sessionId,
+ userId,
+ path: filePath,
+ bytes: contentResult.stdout.length,
+ });
+ return res.json({
+ content: contentResult.stdout.toString(isBinary ? "base64" : "utf8"),
+ path: filePath,
+ encoding: isBinary ? "base64" : "utf8",
+ });
+ } catch (error) {
+ const message = error instanceof Error ? error.message : String(error);
+ fileLogger.error("SSH readFile error:", error);
+ return res.status(500).json({ error: message });
+ }
});
/**
@@ -1369,6 +1337,20 @@ export function registerFileContentRoutes(
let fileName: string | undefined;
let uploadStartTime: number;
let resolved = false;
+ let requestAborted = false;
+ let cleanupStarted = false;
+ let destroyUpload: (() => void) | undefined;
+
+ const abortUpload = () => {
+ if (req.complete || cleanupStarted) return;
+ requestAborted = true;
+ cleanupStarted = true;
+ destroyUpload?.();
+ };
+
+ req.once("aborted", abortUpload);
+ req.once("error", abortUpload);
+ req.once("close", abortUpload);
const bb = Busboy({ headers: req.headers });
@@ -1433,10 +1415,27 @@ export function registerFileContentRoutes(
getSessionSftp(sshConn)
.then((sftp) => {
const writeStream = sftp.createWriteStream(fullPath);
+ const removePartialFile = () => {
+ writeStream.destroy();
+ sftp.unlink(fullPath, (err) => {
+ if (err) {
+ fileLogger.error(
+ "Failed to remove partial file after aborted upload:",
+ err,
+ );
+ }
+ });
+ };
+ destroyUpload = removePartialFile;
+
+ if (requestAborted) {
+ removePartialFile();
+ return;
+ }
writeStream.on("error", (err) => {
fileLogger.error("SFTP write stream error during upload:", err);
- if (!resolved) {
+ if (!resolved && !requestAborted) {
resolved = true;
res
.status(500)
@@ -1444,8 +1443,8 @@ export function registerFileContentRoutes(
}
});
- writeStream.on("finish", () => {
- if (resolved) return;
+ const completeUpload = () => {
+ if (resolved || requestAborted) return;
resolved = true;
fileLogger.success("Streaming file upload completed", {
operation: "file_upload_stream_complete",
@@ -1462,32 +1461,27 @@ export function registerFileContentRoutes(
message: `File uploaded: ${fullPath}`,
},
});
- });
+ };
+ let sourceEnded = false;
+ fileStream.on("end", () => {
+ sourceEnded = true;
+ });
+ writeStream.on("finish", completeUpload);
+ // ssh2's SFTP WriteStream destroys itself inside _final (autoClose),
+ // and a Writable destroyed before its final callback never emits
+ // 'finish' on current Node. 'close' fires once the handle has been
+ // closed after the last write was acknowledged, so it is the
+ // completion signal that reliably arrives -- but only trust it
+ // when the whole body was consumed and nothing aborted the upload.
writeStream.on("close", () => {
- if (resolved) return;
- resolved = true;
- fileLogger.success("Streaming file upload completed", {
- operation: "file_upload_stream_complete",
- sessionId,
- userId,
- path: fullPath,
- duration: Date.now() - uploadStartTime,
- });
- res.json({
- message: "File uploaded successfully",
- path: fullPath,
- toast: {
- type: "success",
- message: `File uploaded: ${fullPath}`,
- },
- });
+ if (sourceEnded) completeUpload();
});
fileStream.on("error", (err) => {
fileLogger.error("File read stream error during upload:", err);
writeStream.destroy();
- if (!resolved) {
+ if (!resolved && !requestAborted) {
resolved = true;
res
.status(500)
@@ -1502,7 +1496,7 @@ export function registerFileContentRoutes(
.catch((err: Error) => {
fileStream.resume();
fileLogger.error("SFTP session error during stream upload:", err);
- if (!resolved) {
+ if (!resolved && !requestAborted) {
resolved = true;
res.status(500).json({ error: `SFTP error: ${err.message}` });
}
@@ -1512,7 +1506,7 @@ export function registerFileContentRoutes(
bb.on("error", (err: Error) => {
fileLogger.error("Busboy parse error during stream upload:", err);
- if (!resolved) {
+ if (!resolved && !requestAborted) {
resolved = true;
res.status(500).json({ error: `Upload parse error: ${err.message}` });
}
@@ -1601,7 +1595,8 @@ export function registerFileContentRoutes(
fail(500, `Upload failed: ${err.message}`);
});
- writeStream.on("finish", () => {
+ let sourceEnded = false;
+ const completeChunk = () => {
if (resolved) return;
resolved = true;
const nextOffset = offset + bytesWritten;
@@ -1624,6 +1619,12 @@ export function registerFileContentRoutes(
nextOffset,
complete: nextOffset >= totalSize,
});
+ };
+ writeStream.on("finish", completeChunk);
+ // See uploadFileStream: ssh2's WriteStream does not emit 'finish'
+ // on current Node; 'close' after the body ended is completion.
+ writeStream.on("close", () => {
+ if (sourceEnded) completeChunk();
});
req.on("error", (err) => {
@@ -1631,9 +1632,21 @@ export function registerFileContentRoutes(
fail(500, `Upload stream error: ${err.message}`);
});
+ if (Buffer.isBuffer(req.body)) {
+ // Some middleware already drained the request into req.body;
+ // there is nothing left to pipe, so write what it collected.
+ bytesWritten = req.body.length;
+ sourceEnded = true;
+ writeStream.end(req.body);
+ return;
+ }
+
req.on("data", (chunk: Buffer) => {
bytesWritten += chunk.length;
});
+ req.on("end", () => {
+ sourceEnded = true;
+ });
req.pipe(writeStream as unknown as NodeJS.WritableStream);
})
diff --git a/src/backend/hosts/file-manager/index.ts b/src/backend/hosts/file-manager/index.ts
index f7cdf52b4..a5b6a6541 100644
--- a/src/backend/hosts/file-manager/index.ts
+++ b/src/backend/hosts/file-manager/index.ts
@@ -1,4 +1,5 @@
import { getErrorMessage } from "../../utils/error-message.js";
+import { usesIssuedCertificate } from "../issued-certificate-auth.js";
import express from "express";
import {
logAudit,
@@ -9,7 +10,7 @@ import { createCorsMiddleware } from "../../utils/cors-config.js";
import { createCompressionMiddleware } from "../../utils/compression-config.js";
import cookieParser from "cookie-parser";
import axios from "axios";
-import ssh2Pkg, { Client as SSHClient } from "ssh2";
+import ssh2Pkg, { Client as SSHClient, type ConnectConfig } from "ssh2";
import { SSH_ALGORITHMS } from "../../utils/ssh-algorithms.js";
import { createCurrentHostResolutionRepository } from "../../database/repositories/factory.js";
import { fileLogger } from "../../utils/logger.js";
@@ -28,7 +29,7 @@ import type {
ConnectionStage,
} from "../../../types/connection-log.js";
import { SSHHostKeyVerifier } from "../host-key-verifier.js";
-import { resolveHostById } from "../host-resolver.js";
+import { resolveHostById, resolveHostBySyncId } from "../host-resolver.js";
import {
startHostTransfer,
getTransferStatus,
@@ -62,11 +63,13 @@ import {
hostAddressMismatch,
HostAddressMismatchError,
HostNotOnThisServerError,
-} from "../terminal/host-identity.js";
+ resolveServerHostId,
+} from "../host-identity.js";
import { registerFileDownloadRoutes } from "./download-routes.js";
import { registerFileActionRoutes } from "./action-routes.js";
import { applyAgentAuth } from "../terminal-auth-helpers.js";
import { applyCACertIfPresent } from "./ca-cert-auth.js";
+import { listenOnServicePort } from "../../utils/service-listen.js";
/**
* The host id came from whichever database the client is displaying. If this
@@ -117,21 +120,33 @@ function assertResolvedHost(
}
const app = express();
+app.set("trust proxy", "loopback");
app.use(createCompressionMiddleware());
app.use(createCorsMiddleware(["GET", "POST", "PUT", "DELETE", "OPTIONS"]));
app.use(cookieParser());
+const authManager = AuthManager.getInstance();
+app.use(authManager.createAuthMiddleware());
app.use(express.json({ limit: "1gb" }));
app.use(express.urlencoded({ limit: "1gb", extended: true }));
-app.use(express.raw({ limit: "5gb", type: "application/octet-stream" }));
+// uploadFileChunk streams its octet-stream body straight into SFTP; the raw
+// body parser would otherwise buffer the whole chunk in memory first and,
+// worse, drain the request so nothing is left for the route to pipe (the
+// remote file ended up empty and the request never completed).
+const rawBodyParser = express.raw({
+ limit: "5gb",
+ type: "application/octet-stream",
+});
+const STREAMED_BODY_ROUTES = new Set(["/ssh/file_manager/ssh/uploadFileChunk"]);
+app.use((req, res, next) => {
+ if (STREAMED_BODY_ROUTES.has(req.path)) return next();
+ rawBodyParser(req, res, next);
+});
app.use((_req, res, next) => {
res.setHeader("Cache-Control", "no-store");
next();
});
-const authManager = AuthManager.getInstance();
-app.use(authManager.createAuthMiddleware());
-
const sshSessions: Record = {};
const pendingTOTPSessions: Record = {};
// Keyed by "sessionId:path" to prevent concurrent requests for the same path
@@ -289,7 +304,7 @@ async function buildDedicatedTransferConnectConfig(
throw new Error("Password required for transfer connection");
}
config.password = host.password;
- } else if (authType === "opkssh") {
+ } else if (usesIssuedCertificate(authType)) {
const { getOPKSSHToken } = await import("../opkssh-auth.js");
const token = await getOPKSSHToken(userId, host.id);
if (!token) {
@@ -828,6 +843,7 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
let resolvedSocks5Username = socks5Username;
let resolvedSocks5Password = socks5Password;
let resolvedSocks5ProxyChain = socks5ProxyChain;
+ let resolvedVaultProfileId: number | null = null;
if (hostId && userId && !password && !sshKey) {
try {
const { resolveHostById, resolveHostBySyncId } =
@@ -854,6 +870,9 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
hostKeepaliveInterval = resolvedHost.terminalConfig?.keepaliveInterval;
hostKeepaliveCountMax = resolvedHost.terminalConfig?.keepaliveCountMax;
resolvedScpLegacy = resolvedHost.scpLegacy ?? false;
+ resolvedVaultProfileId =
+ (resolvedHost.vaultProfile as { id?: number } | undefined)?.id ??
+ null;
if (resolvedHost.useSocks5) {
resolvedUseSocks5 = resolvedHost.useSocks5;
resolvedSocks5Host = resolvedHost.socks5Host;
@@ -923,6 +942,9 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
hostKeepaliveInterval = resolvedHost.terminalConfig?.keepaliveInterval;
hostKeepaliveCountMax = resolvedHost.terminalConfig?.keepaliveCountMax;
resolvedScpLegacy = resolvedHost.scpLegacy ?? false;
+ resolvedVaultProfileId =
+ (resolvedHost.vaultProfile as { id?: number } | undefined)?.id ??
+ null;
if (resolvedHost.useSocks5) {
resolvedUseSocks5 = resolvedHost.useSocks5;
resolvedSocks5Host = resolvedHost.socks5Host;
@@ -968,7 +990,15 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
}
}
- const preloadedHostData = await SSHHostKeyVerifier.preloadHostData(hostId);
+ let serverHostId = hostId;
+ if (hostSyncId && userId) {
+ const resolvedHost = await resolveHostBySyncId(hostSyncId, userId);
+ assertResolvedHost(ip, hostSyncId, resolvedHost, hostId, userId);
+ serverHostId = resolveServerHostId(hostId, resolvedHost) ?? hostId;
+ }
+
+ const preloadedHostData =
+ await SSHHostKeyVerifier.preloadHostData(serverHostId);
const keepalive = resolveSshKeepalive(
hostKeepaliveInterval,
hostKeepaliveCountMax,
@@ -985,7 +1015,7 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
tcpKeepAlive: true,
tcpKeepAliveInitialDelay: 30000,
hostVerifier: await SSHHostKeyVerifier.createHostVerifier(
- hostId,
+ serverHostId,
resolvedIp,
resolvedPort,
null,
@@ -1120,10 +1150,10 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
connectionLogs.push(
createConnectionLog("info", "sftp_auth", "Using password authentication"),
);
- } else if (resolvedCredentials.authType === "opkssh") {
+ } else if (usesIssuedCertificate(resolvedCredentials.authType)) {
try {
const { getOPKSSHToken } = await import("../opkssh-auth.js");
- const token = await getOPKSSHToken(userId, hostId);
+ const token = await getOPKSSHToken(userId, serverHostId);
if (!token) {
connectionLogs.push(
@@ -1174,6 +1204,38 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
connectionLogs,
});
}
+ } else if (resolvedCredentials.authType === "vault") {
+ try {
+ const { setupVaultSshSignerAuth } =
+ await import("../vault-ssh-connect.js");
+ await setupVaultSshSignerAuth(config as ConnectConfig, client, {
+ id: serverHostId,
+ username: resolvedUsername,
+ userId,
+ vaultProfile: { id: resolvedVaultProfileId },
+ });
+ connectionLogs.push(
+ createConnectionLog(
+ "info",
+ "sftp_auth",
+ "Using cached Vault-signed certificate",
+ ),
+ );
+ } catch (vaultError) {
+ const message = getErrorMessage(vaultError);
+ fileLogger.warn("Vault authentication unavailable for file manager", {
+ operation: "file_connect_vault_auth",
+ sessionId,
+ hostId,
+ error: message,
+ });
+ connectionLogs.push(createConnectionLog("error", "sftp_auth", message));
+ return res.status(401).json({
+ error: message,
+ requiresVaultAuth: true,
+ connectionLogs,
+ });
+ }
} else if (resolvedCredentials.authType === "agent") {
const result = await applyAgentAuth(config, resolvedTerminalConfig);
if ("error" in result) {
@@ -1255,7 +1317,7 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
operation: "file_ssh_connected",
sessionId,
userId,
- hostId,
+ hostId: serverHostId,
ip,
port,
username,
@@ -1283,7 +1345,7 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
userId,
ip,
port,
- hostId,
+ hostId: serverHostId,
username,
sudoPassword: resolvedCredentials.sudoPassword,
scpLegacy: resolvedScpLegacy,
@@ -1298,7 +1360,7 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
username: await getAuditUsername(userId),
action: "file_manager_connect",
resourceType: "host",
- resourceId: hostId ? String(hostId) : undefined,
+ resourceId: serverHostId ? String(serverHostId) : undefined,
resourceName: `${username}@${ip}:${port}`,
ipAddress,
userAgent,
@@ -3128,16 +3190,27 @@ process.on("SIGTERM", () => {
const PORT = 30004;
try {
- const server = app.listen(PORT, async () => {
- try {
- await authManager.initialize();
- } catch (err) {
- fileLogger.error("Failed to initialize AuthManager", err, {
- operation: "auth_init_error",
- });
- }
+ const server = listenOnServicePort({
+ app,
+ port: PORT,
+ logger: fileLogger,
+ serviceName: "file-manager",
+ onListening: async () => {
+ try {
+ await authManager.initialize();
+ } catch (err) {
+ fileLogger.error("Failed to initialize AuthManager", err, {
+ operation: "auth_init_error",
+ });
+ }
+ },
});
+ // Uploads are streamed and may legitimately take longer than Node's default
+ // five-minute request deadline. Connection liveness is handled by the proxy
+ // and socket-level timeouts instead of a total request duration cap.
+ server.requestTimeout = 0;
+
server.on("error", (err) => {
fileLogger.error("File Manager server error", err, {
operation: "file_manager_server_error",
diff --git a/src/backend/hosts/file-manager/list-routes.ts b/src/backend/hosts/file-manager/list-routes.ts
index 40e70724b..098fa1267 100644
--- a/src/backend/hosts/file-manager/list-routes.ts
+++ b/src/backend/hosts/file-manager/list-routes.ts
@@ -54,7 +54,7 @@ export function registerFileListingRoutes(
app.get("/ssh/file_manager/ssh/listFiles", (req, res) => {
const sessionId = req.query.sessionId as string;
const sshConn = sshSessions[sessionId];
- const sshPath = decodeURIComponent((req.query.path as string) || "/");
+ const sshPath = (req.query.path as string) || "/";
const userId = (req as AuthenticatedRequest).userId;
if (!sessionId) {
diff --git a/src/backend/hosts/file-manager/operation-routes.ts b/src/backend/hosts/file-manager/operation-routes.ts
index 952dfc80b..851f04a2e 100644
--- a/src/backend/hosts/file-manager/operation-routes.ts
+++ b/src/backend/hosts/file-manager/operation-routes.ts
@@ -7,6 +7,7 @@ import {
getSessionSftp,
type SSHSession,
} from "./session.js";
+import { ensureDirectoryTreeSftp } from "./transfer-sftp-dir.js";
import { buildDeleteCommand } from "./operation-commands.js";
import {
emptyTrash,
@@ -354,99 +355,20 @@ export function registerFileOperationRoutes(
userId,
path: fullPath,
});
- const escapedPath = fullPath.replace(/'/g, "'\"'\"'");
-
- const createCommand = `mkdir -p '${escapedPath}' && echo "SUCCESS" && exit 0`;
-
- execChannel(sshConn, createCommand, (err, stream) => {
- if (err) {
- fileLogger.error("SSH createFolder error:", err);
- if (!res.headersSent) {
- return res.status(500).json({ error: err.message });
- }
- return;
- }
-
- let outputData = "";
- let errorData = "";
-
- stream.on("data", (chunk: Buffer) => {
- outputData += chunk.toString();
+ try {
+ await ensureDirectoryTreeSftp(await getSessionSftp(sshConn), fullPath);
+ res.json({
+ message: "Folder created successfully",
+ path: fullPath,
+ toast: { type: "success", message: `Folder created: ${fullPath}` },
});
-
- stream.stderr.on("data", (chunk: Buffer) => {
- errorData += chunk.toString();
-
- if (chunk.toString().includes("Permission denied")) {
- fileLogger.error(`Permission denied creating folder: ${fullPath}`);
- if (!res.headersSent) {
- return res.status(403).json({
- error: `Permission denied: Cannot create folder ${fullPath}. Check directory permissions.`,
- });
- }
- return;
- }
+ } catch (error) {
+ fileLogger.error("SFTP createFolder failed", error);
+ const code = (error as { code?: string | number }).code;
+ res.status(code === 3 || code === "EACCES" ? 403 : 500).json({
+ error: (error as Error).message,
});
-
- stream.on("close", (code) => {
- if (outputData.includes("SUCCESS")) {
- fileLogger.success("Directory created successfully", {
- operation: "file_mkdir_success",
- sessionId,
- userId,
- path: fullPath,
- });
- if (!res.headersSent) {
- res.json({
- message: "Folder created successfully",
- path: fullPath,
- toast: {
- type: "success",
- message: `Folder created: ${fullPath}`,
- },
- });
- }
- return;
- }
-
- if (code !== 0) {
- fileLogger.error(
- `SSH createFolder command failed with code ${code}: ${errorData.replace(/\n/g, " ").trim()}`,
- );
- if (!res.headersSent) {
- return res.status(500).json({
- error: `Command failed: ${errorData}`,
- toast: {
- type: "error",
- message: `Folder creation failed: ${errorData}`,
- },
- });
- }
- return;
- }
-
- fileLogger.success("Directory created successfully", {
- operation: "file_mkdir_success",
- sessionId,
- userId,
- path: fullPath,
- });
- if (!res.headersSent) {
- res.json({
- message: "Folder created successfully",
- path: fullPath,
- toast: { type: "success", message: `Folder created: ${fullPath}` },
- });
- }
- });
-
- stream.on("error", (streamErr) => {
- fileLogger.error("SSH createFolder stream error:", streamErr);
- if (!res.headersSent) {
- res.status(500).json({ error: `Stream error: ${streamErr.message}` });
- }
- });
- });
+ }
});
/**
diff --git a/src/backend/hosts/file-manager/session.ts b/src/backend/hosts/file-manager/session.ts
index 8c11081e2..cc8c7df29 100644
--- a/src/backend/hosts/file-manager/session.ts
+++ b/src/backend/hosts/file-manager/session.ts
@@ -76,10 +76,15 @@ export function execWithSudoBuffer(
session: SSHSession,
command: string,
sudoPassword: string,
-): Promise<{ stdout: Buffer; stderr: string; code: number }> {
+ maxStdoutBytes?: number,
+): Promise<{
+ stdout: Buffer;
+ stderr: string;
+ code: number;
+ exceededLimit?: boolean;
+}> {
return new Promise((resolve) => {
- const escapedPassword = sudoPassword.replace(/'/g, "'\"'\"'");
- const sudoCommand = `echo '${escapedPassword}' | sudo -S ${command} 2>&1`;
+ const sudoCommand = `sudo -S -p '' ${command} 2>&1`;
execChannel(session, sudoCommand, (err, stream) => {
if (err) {
@@ -88,9 +93,33 @@ export function execWithSudoBuffer(
}
const stdoutChunks: Buffer[] = [];
+ let stdoutBytes = 0;
let stderr = "";
+ let settled = false;
+
+ const finish = (
+ code: number,
+ extra: { exceededLimit?: boolean } = {},
+ ) => {
+ if (settled) return;
+ settled = true;
+ resolve({
+ stdout: Buffer.concat(stdoutChunks),
+ stderr,
+ code,
+ ...extra,
+ });
+ };
stream.on("data", (chunk: Buffer) => {
+ if (settled) return;
+ stdoutBytes += chunk.length;
+ if (maxStdoutBytes !== undefined && stdoutBytes > maxStdoutBytes) {
+ stderr = `Command output exceeds ${maxStdoutBytes} bytes`;
+ finish(1, { exceededLimit: true });
+ stream.close();
+ return;
+ }
stdoutChunks.push(chunk);
});
@@ -99,6 +128,7 @@ export function execWithSudoBuffer(
});
stream.on("close", (code: number) => {
+ if (settled) return;
let stdout = Buffer.concat(stdoutChunks);
const sudoPromptMatch = stdout
.toString("utf8", 0, Math.min(stdout.length, 256))
@@ -106,15 +136,74 @@ export function execWithSudoBuffer(
if (sudoPromptMatch) {
stdout = stdout.subarray(Buffer.byteLength(sudoPromptMatch[0]));
}
+ settled = true;
resolve({ stdout, stderr, code: code || 0 });
});
stream.on("error", (streamErr: Error) => {
+ stderr = streamErr.message;
+ finish(1);
+ });
+
+ stream.write(`${sudoPassword}\n`);
+ });
+ });
+}
+
+export function execBuffer(
+ session: SSHSession,
+ command: string,
+ maxStdoutBytes?: number,
+): Promise<{
+ stdout: Buffer;
+ stderr: string;
+ code: number;
+ exceededLimit?: boolean;
+}> {
+ return new Promise((resolve) => {
+ execChannel(session, command, (err, stream) => {
+ if (err) {
+ resolve({ stdout: Buffer.alloc(0), stderr: err.message, code: 1 });
+ return;
+ }
+
+ const stdoutChunks: Buffer[] = [];
+ let stdoutBytes = 0;
+ let stderr = "";
+ let settled = false;
+
+ const finish = (
+ code: number,
+ extra: { exceededLimit?: boolean } = {},
+ ) => {
+ if (settled) return;
+ settled = true;
resolve({
stdout: Buffer.concat(stdoutChunks),
- stderr: streamErr.message,
- code: 1,
+ stderr,
+ code,
+ ...extra,
});
+ };
+
+ stream.on("data", (chunk: Buffer) => {
+ if (settled) return;
+ stdoutBytes += chunk.length;
+ if (maxStdoutBytes !== undefined && stdoutBytes > maxStdoutBytes) {
+ stderr = `Command output exceeds ${maxStdoutBytes} bytes`;
+ finish(1, { exceededLimit: true });
+ stream.close();
+ return;
+ }
+ stdoutChunks.push(chunk);
+ });
+ stream.stderr.on("data", (chunk: Buffer) => {
+ stderr += chunk.toString();
+ });
+ stream.on("close", (code: number) => finish(code || 0));
+ stream.on("error", (streamErr: Error) => {
+ stderr = stderr || streamErr.message;
+ finish(1);
});
});
});
diff --git a/src/backend/hosts/guacamole/drive-settings.ts b/src/backend/hosts/guacamole/drive-settings.ts
new file mode 100644
index 000000000..12baa0ca7
--- /dev/null
+++ b/src/backend/hosts/guacamole/drive-settings.ts
@@ -0,0 +1,29 @@
+export const GUACD_DRIVE_PATH_ENV = "GUACD_DRIVE_PATH";
+const DEFAULT_DRIVE_ROOT = "/drive";
+
+/**
+ * Fills in where guacd keeps the files behind RDP drive redirection.
+ *
+ * The folder lives on the guacd host, not on Termix's - with the stock
+ * compose it is a directory in the shared termix-data volume, configured
+ * through GUACD_DRIVE_PATH. Each user gets a folder of their own underneath:
+ * a shared drive would show everyone's uploads to everyone else. A host that
+ * names its own drive-path keeps it.
+ */
+export function withDriveSettings(
+ guacConfig: Record,
+ userId: string,
+ env: NodeJS.ProcessEnv = process.env,
+): Record {
+ if (!guacConfig["enable-drive"] || guacConfig["drive-path"]) {
+ return guacConfig;
+ }
+ const root = (
+ env[GUACD_DRIVE_PATH_ENV]?.trim() || DEFAULT_DRIVE_ROOT
+ ).replace(/\/+$/, "");
+ return {
+ ...guacConfig,
+ "drive-path": `${root}/${userId}`,
+ "create-drive-path": true,
+ };
+}
diff --git a/src/backend/hosts/guacamole/guacamole-server.ts b/src/backend/hosts/guacamole/guacamole-server.ts
index 25e3ad3ec..f52ee7f0f 100644
--- a/src/backend/hosts/guacamole/guacamole-server.ts
+++ b/src/backend/hosts/guacamole/guacamole-server.ts
@@ -57,30 +57,12 @@ export interface GuacSessionInfo {
const guacSessionByConnectId = new Map();
// Keyed by guacd's own guacamoleConnectionId, for join-time lookups.
const guacSessionByGuacamoleId = new Map();
-const pendingConnectResolvers = new Map<
- string,
- (info: GuacSessionInfo | null) => void
->();
-
-export function waitForGuacdOpen(
- termixConnectId: string,
- timeoutMs = 10000,
-): Promise {
- const existing = guacSessionByConnectId.get(termixConnectId);
- if (existing) return Promise.resolve(existing);
-
- return new Promise((resolve) => {
- let settled = false;
- const finish = (info: GuacSessionInfo | null) => {
- if (settled) return;
- settled = true;
- pendingConnectResolvers.delete(termixConnectId);
- resolve(info);
- };
-
- pendingConnectResolvers.set(termixConnectId, finish);
- setTimeout(() => finish(null), timeoutMs);
- });
+export function getGuacSessionByConnectId(
+ connectId: string,
+ userId: string,
+): GuacSessionInfo | null {
+ const info = guacSessionByConnectId.get(connectId);
+ return info?.ownerUserId === userId ? info : null;
}
export function getGuacSessionInfo(
@@ -140,6 +122,7 @@ async function persistGuacamoleRecording(
}
const websocketOptions = {
+ host: "127.0.0.1",
port: GUAC_WS_PORT,
};
@@ -230,9 +213,6 @@ function createGuacServer(): GuacamoleLite {
};
guacSessionByConnectId.set(termixMeta.termixConnectId, info);
guacSessionByGuacamoleId.set(guacamoleConnectionId, info);
-
- const resolver = pendingConnectResolvers.get(termixMeta.termixConnectId);
- if (resolver) resolver(info);
}
});
diff --git a/src/backend/hosts/guacamole/macos-vnc-proxy.ts b/src/backend/hosts/guacamole/macos-vnc-proxy.ts
new file mode 100644
index 000000000..b3c420a82
--- /dev/null
+++ b/src/backend/hosts/guacamole/macos-vnc-proxy.ts
@@ -0,0 +1,97 @@
+import net from "net";
+
+const RFB_BANNER_LENGTH = 12;
+const VNC_AUTH_SECURITY_TYPE = 2;
+const MACOS_RFB_BANNER = Buffer.from("RFB 003.889\n", "ascii");
+const STANDARD_RFB_BANNER = Buffer.from("RFB 003.008\n", "ascii");
+
+export interface VncCompatibilityProxy {
+ port: number;
+ close: () => void;
+}
+
+export async function createMacosVncCompatibilityProxy({
+ targetHost,
+ targetPort,
+ bindHost,
+}: {
+ targetHost: string;
+ targetPort: number;
+ bindHost: string;
+}): Promise {
+ const sockets = new Set();
+ const server = net.createServer((client) => {
+ const upstream = net.createConnection(targetPort, targetHost);
+ sockets.add(client);
+ sockets.add(upstream);
+
+ const forget = (socket: net.Socket) => sockets.delete(socket);
+ client.once("close", () => forget(client));
+ upstream.once("close", () => forget(upstream));
+ client.once("error", () => upstream.destroy());
+ upstream.once("error", () => client.destroy());
+ client.pipe(upstream);
+
+ let pending = Buffer.alloc(0);
+ const forwardMacosSecurityTypes = (chunk: Buffer) => {
+ pending = Buffer.concat([pending, chunk]);
+ if (pending.length < 1) return;
+
+ const securityTypeCount = pending[0];
+ if (securityTypeCount === 0) {
+ upstream.off("data", forwardMacosSecurityTypes);
+ client.write(pending);
+ upstream.pipe(client);
+ return;
+ }
+ if (pending.length < 1 + securityTypeCount) return;
+
+ upstream.off("data", forwardMacosSecurityTypes);
+ const securityTypes = pending.subarray(1, 1 + securityTypeCount);
+ if (securityTypes.includes(VNC_AUTH_SECURITY_TYPE)) {
+ client.write(Buffer.from([1, VNC_AUTH_SECURITY_TYPE]));
+ } else {
+ client.write(pending.subarray(0, 1 + securityTypeCount));
+ }
+ client.write(pending.subarray(1 + securityTypeCount));
+ upstream.pipe(client);
+ };
+
+ const forwardServerBanner = (chunk: Buffer) => {
+ pending = Buffer.concat([pending, chunk]);
+ if (pending.length < RFB_BANNER_LENGTH) return;
+
+ upstream.off("data", forwardServerBanner);
+ const banner = pending.subarray(0, RFB_BANNER_LENGTH);
+ const remainder = pending.subarray(RFB_BANNER_LENGTH);
+ if (banner.equals(MACOS_RFB_BANNER)) {
+ client.write(STANDARD_RFB_BANNER);
+ pending = Buffer.alloc(0);
+ upstream.on("data", forwardMacosSecurityTypes);
+ if (remainder.length > 0) forwardMacosSecurityTypes(remainder);
+ } else {
+ client.write(banner);
+ client.write(remainder);
+ upstream.pipe(client);
+ }
+ };
+ upstream.on("data", forwardServerBanner);
+ });
+
+ const port = await new Promise((resolve, reject) => {
+ server.once("error", reject);
+ server.listen(0, bindHost, () => {
+ server.off("error", reject);
+ resolve((server.address() as net.AddressInfo).port);
+ });
+ });
+ server.unref();
+
+ return {
+ port,
+ close: () => {
+ server.close();
+ for (const socket of sockets) socket.destroy();
+ },
+ };
+}
diff --git a/src/backend/hosts/guacamole/rdp-settings.ts b/src/backend/hosts/guacamole/rdp-settings.ts
index 63ada8e14..305c153cb 100644
--- a/src/backend/hosts/guacamole/rdp-settings.ts
+++ b/src/backend/hosts/guacamole/rdp-settings.ts
@@ -34,3 +34,31 @@ export function resolveRdpDomain(
? promptedDomain
: storedDomain;
}
+
+type SharedRdpAuthResolution =
+ | { source: "personal-override" }
+ | { source: "owner-shared"; authType: string }
+ | { source: "secretless" }
+ | { source: "required" }
+ | null;
+
+export function resolveRdpAuthTypeForConnect({
+ storedAuthType,
+ credentialId,
+ sharedResolution,
+}: {
+ storedAuthType?: string | null;
+ credentialId?: number | null;
+ sharedResolution?: SharedRdpAuthResolution;
+}): string {
+ if (sharedResolution === undefined) {
+ return storedAuthType || (credentialId ? "credential" : "direct");
+ }
+ if (sharedResolution?.source === "personal-override") return "credential";
+ if (sharedResolution?.source === "owner-shared") {
+ return sharedResolution.authType;
+ }
+ return sharedResolution?.source === "secretless" && storedAuthType === "none"
+ ? "none"
+ : "direct";
+}
diff --git a/src/backend/hosts/guacamole/routes.ts b/src/backend/hosts/guacamole/routes.ts
index 628f50616..39a27e3fa 100644
--- a/src/backend/hosts/guacamole/routes.ts
+++ b/src/backend/hosts/guacamole/routes.ts
@@ -2,9 +2,15 @@ import { getErrorMessage } from "../../utils/error-message.js";
import express from "express";
import { GuacamoleTokenService } from "./token-service.js";
import { withRecordingSettings } from "./recording-settings.js";
+import { withDriveSettings } from "./drive-settings.js";
import { guacLogger } from "../../utils/logger.js";
import { AuthManager } from "../../utils/auth-manager.js";
import { PermissionManager } from "../../utils/permission-manager.js";
+import {
+ resolveRecipientSharedHostAuthentication,
+ type RecipientSharedHostAuthResolution,
+} from "../../utils/shared-host-auth-resolver.js";
+import type { AuthOverrideProtocol } from "../../../types/auth-protocols.js";
import net from "net";
import crypto from "crypto";
import path from "path";
@@ -15,14 +21,19 @@ import {
} from "../../database/repositories/factory.js";
import { resolveGuacdOptions } from "../../utils/guacd-config.js";
import { createJumpHostChain } from "../jump-host-chain.js";
-import { waitForGuacdOpen } from "./guacamole-server.js";
+import { getGuacSessionByConnectId } from "./guacamole-server.js";
import {
logAudit,
getAuditUsername,
getRequestMeta,
} from "../../utils/audit-logger.js";
import { resolveJumpTunnelEndpoint } from "./jump-tunnel-endpoint.js";
-import { buildRdpSettings, resolveRdpDomain } from "./rdp-settings.js";
+import {
+ buildRdpSettings,
+ resolveRdpAuthTypeForConnect,
+ resolveRdpDomain,
+} from "./rdp-settings.js";
+import { createMacosVncCompatibilityProxy } from "./macos-vnc-proxy.js";
const router = express.Router();
const tokenService = GuacamoleTokenService.getInstance();
@@ -31,6 +42,16 @@ const DATA_DIR = process.env.DATA_DIR || "./db/data";
router.use(authManager.createAuthMiddleware());
+router.get("/connection/:connectId", (req: AuthenticatedRequest, res) => {
+ if (!req.userId)
+ return res.status(401).json({ error: "Authentication required" });
+ const session = getGuacSessionByConnectId(
+ String(req.params.connectId),
+ req.userId,
+ );
+ res.json({ guacamoleConnectionId: session?.guacamoleConnectionId ?? null });
+});
+
/**
* @openapi
* /guacamole/token:
@@ -195,7 +216,10 @@ router.post("/token", async (req, res) => {
* guacamoleConnectionId:
* type: string
* nullable: true
- * description: guacd's own connection id for this session, once the handshake completes. Used to mint session-share join tokens.
+ * description: Null until the WebSocket handshake completes. Query /guacamole/connection/{connectId} for the session-sharing ID.
+ * termixConnectId:
+ * type: string
+ * description: Correlation ID for looking up this connection after the WebSocket opens.
* 400:
* description: Invalid request or unsupported connection type
* 403:
@@ -318,6 +342,7 @@ router.post(
const hostRecord = host as Record;
const hostRepository = hostResolutionRepository;
const isSharedConnection = host.userId !== userId;
+ let sharedAuthResolution: RecipientSharedHostAuthResolution | null = null;
if (isSharedConnection) {
// Recipients never read the owner's raw secrets; wipe them and use
@@ -331,30 +356,35 @@ router.post(
host.telnetPassword = null;
try {
- const { SharedHostSecretsManager } =
- await import("../../utils/shared-host-secrets-manager.js");
- const secret =
- await SharedHostSecretsManager.getInstance().getSecretForUser(
- hostId,
- userId,
- connectionType as "rdp" | "vnc" | "telnet",
- );
- if (secret) {
+ const resolution = await resolveRecipientSharedHostAuthentication(
+ host,
+ hostId,
+ userId,
+ connectionType as AuthOverrideProtocol,
+ );
+ sharedAuthResolution = resolution;
+ const auth =
+ resolution.source === "personal-override"
+ ? { ...resolution.credential, domain: null }
+ : resolution.source === "owner-shared"
+ ? resolution.secret
+ : null;
+ if (auth) {
if (connectionType === "rdp") {
- host.rdpUser = secret.username ?? null;
- host.rdpPassword = secret.password ?? null;
- if (secret.domain) host.rdpDomain = secret.domain;
+ host.rdpUser = auth.username ?? null;
+ host.rdpPassword = auth.password ?? null;
+ if (auth.domain) host.rdpDomain = auth.domain;
} else if (connectionType === "vnc") {
- host.vncUser = secret.username ?? null;
- host.vncPassword = secret.password ?? null;
+ host.vncUser = auth.username ?? null;
+ host.vncPassword = auth.password ?? null;
} else if (connectionType === "telnet") {
- host.telnetUser = secret.username ?? null;
- host.telnetPassword = secret.password ?? null;
+ host.telnetUser = auth.username ?? null;
+ host.telnetPassword = auth.password ?? null;
}
}
} catch (e) {
- guacLogger.warn("Failed to resolve shared host secret", {
- operation: "guac_shared_secret_resolve",
+ guacLogger.warn("Failed to resolve shared host auth", {
+ operation: "guac_shared_auth_resolve",
hostId,
protocol: connectionType,
error: getErrorMessage(e, "Unknown"),
@@ -440,10 +470,11 @@ router.post(
let username: string;
let password: string;
- const rdpAuthTypeForConnect = isSharedConnection
- ? null
- : (host.rdpAuthType as string) ||
- (host.rdpCredentialId ? "credential" : "direct");
+ const rdpAuthTypeForConnect = resolveRdpAuthTypeForConnect({
+ storedAuthType: host.rdpAuthType as string | null,
+ credentialId: host.rdpCredentialId as number | null,
+ sharedResolution: isSharedConnection ? sharedAuthResolution : undefined,
+ });
switch (connectionType) {
case "rdp":
@@ -495,20 +526,24 @@ router.post(
}
}
+ let tunnelEndpoint: ReturnType | null =
+ null;
+ if (jumpHosts.length > 0 || (connectionType === "vnc" && !username)) {
+ let guacdUrl: string | undefined;
+ try {
+ guacdUrl =
+ (await createCurrentSettingsRepository().get("guac_url")) ??
+ undefined;
+ } catch {
+ // Environment/default guacd configuration remains available.
+ }
+ const guacdHost =
+ perConnectionGuacdHost || resolveGuacdOptions(guacdUrl).host;
+ tunnelEndpoint = resolveJumpTunnelEndpoint(guacdHost);
+ }
+
if (jumpHosts.length > 0) {
try {
- let guacdUrl: string | undefined;
- try {
- guacdUrl =
- (await createCurrentSettingsRepository().get("guac_url")) ??
- undefined;
- } catch {
- // Environment/default guacd configuration remains available.
- }
- const guacdHost =
- perConnectionGuacdHost || resolveGuacdOptions(guacdUrl).host;
- const tunnelEndpoint = resolveJumpTunnelEndpoint(guacdHost);
-
// The chain dials the first hop through that hop's own SOCKS5
// settings; the target host's proxy config does not apply to it.
const jumpClient = await createJumpHostChain(jumpHosts, userId);
@@ -543,7 +578,7 @@ router.post(
);
});
server.on("error", reject);
- server.listen(0, tunnelEndpoint.bindHost, () => {
+ server.listen(0, tunnelEndpoint!.bindHost, () => {
const addr = server.address() as net.AddressInfo;
// Auto-cleanup after 1 hour
setTimeout(
@@ -556,7 +591,7 @@ router.post(
resolve(addr.port);
});
});
- hostname = tunnelEndpoint.advertisedHost;
+ hostname = tunnelEndpoint!.advertisedHost;
port = tunnelPort;
guacLogger.info("SSH tunnel established for guacamole", {
operation: "guac_ssh_tunnel",
@@ -574,6 +609,36 @@ router.post(
}
}
+ if (connectionType === "vnc" && !username) {
+ try {
+ const proxy = await createMacosVncCompatibilityProxy({
+ targetHost: hostname,
+ targetPort: port,
+ bindHost: tunnelEndpoint!.bindHost,
+ });
+ hostname = tunnelEndpoint!.advertisedHost;
+ port = proxy.port;
+ setTimeout(proxy.close, 60 * 60 * 1000).unref();
+ guacLogger.info("VNC compatibility proxy established", {
+ operation: "guac_vnc_compatibility_proxy",
+ hostId,
+ proxyPort: port,
+ });
+ } catch (proxyError) {
+ guacLogger.error(
+ "Failed to establish VNC compatibility proxy",
+ proxyError,
+ {
+ operation: "guac_vnc_compatibility_proxy_error",
+ hostId,
+ },
+ );
+ return res.status(500).json({
+ error: "Failed to establish VNC compatibility proxy",
+ });
+ }
+ }
+
const guacdOverrides = {
...(perConnectionGuacdHost
? { guacdHost: perConnectionGuacdHost }
@@ -617,10 +682,7 @@ router.post(
switch (connectionType) {
case "rdp":
- if (guacConfig["enable-drive"] && !guacConfig["drive-path"]) {
- guacConfig["drive-path"] = "/drive";
- guacConfig["create-drive-path"] = true;
- }
+ guacConfig = withDriveSettings(guacConfig, userId);
token = tokenService.createRdpToken(
hostname,
username,
@@ -677,8 +739,6 @@ router.post(
return res.status(400).json({ error: "Invalid connection type" });
}
- const sessionInfo = await waitForGuacdOpen(termixConnectId, 10000);
-
const { ipAddress, userAgent } = getRequestMeta(req);
await logAudit({
userId,
@@ -694,7 +754,8 @@ router.post(
res.json({
token,
- guacamoleConnectionId: sessionInfo?.guacamoleConnectionId ?? null,
+ termixConnectId,
+ guacamoleConnectionId: null,
});
} catch (error) {
guacLogger.error("Failed to generate guacamole token for host", error, {
diff --git a/src/backend/hosts/terminal/host-identity.ts b/src/backend/hosts/host-identity.ts
similarity index 94%
rename from src/backend/hosts/terminal/host-identity.ts
rename to src/backend/hosts/host-identity.ts
index 92cf91885..b4314a687 100644
--- a/src/backend/hosts/terminal/host-identity.ts
+++ b/src/backend/hosts/host-identity.ts
@@ -64,6 +64,13 @@ export function resolveServerJumpHosts(
return clientJumpHosts?.length ? clientJumpHosts : serverJumpHosts;
}
+export function resolveServerHostId(
+ clientHostId: number | null,
+ resolvedHost: { id?: unknown } | null,
+): number | null {
+ return typeof resolvedHost?.id === "number" ? resolvedHost.id : clientHostId;
+}
+
/**
* Thrown where a mismatch is reported by rejecting rather than by messaging
* the socket. Callers whose host-resolution is wrapped in a "failed to resolve
diff --git a/src/backend/hosts/host-key-verifier.ts b/src/backend/hosts/host-key-verifier.ts
index 111021aca..80ef19fdd 100644
--- a/src/backend/hosts/host-key-verifier.ts
+++ b/src/backend/hosts/host-key-verifier.ts
@@ -1,3 +1,4 @@
+import { authFailureTracker } from "./metrics/state.js";
import type { WebSocket } from "ws";
import { createCurrentHostResolutionRepository } from "../database/repositories/factory.js";
import { sshLogger } from "../utils/logger.js";
@@ -327,6 +328,7 @@ export class SSHHostKeyVerifier {
algorithm,
currentChangeCount,
);
+ authFailureTracker.resetHostKeyFailure(hostId);
}
private static async promptUserForNewKey(
diff --git a/src/backend/hosts/host-resolver.ts b/src/backend/hosts/host-resolver.ts
index e7739fe34..5a48c7989 100644
--- a/src/backend/hosts/host-resolver.ts
+++ b/src/backend/hosts/host-resolver.ts
@@ -1,4 +1,6 @@
import { getErrorMessage } from "../utils/error-message.js";
+import { findUsableCredential } from "./usable-credential.js";
+import { resolveExternalSecretRefs } from "./external-secrets.js";
import {
createCurrentHostResolutionRepository,
createCurrentVaultProfileRepository,
@@ -189,7 +191,7 @@ export async function resolveHostById(
if (effectiveCredentialId) {
try {
- const cred = (await repository.findCredentialByIdForUser(
+ const cred = (await findUsableCredential(
effectiveCredentialId,
ownerId,
)) as Record | null;
@@ -229,6 +231,14 @@ export async function resolveHostById(
ownerEquivalent ? ownerId : userId,
);
+ // "op://..." references become real secrets here, once, for everyone
+ // downstream. They resolve in the context of whoever owns the secret
+ // fields: the owner for their own host, the recipient for an override.
+ await resolveExternalSecretRefs(
+ host as Record,
+ sharedAuthResolution === "recipient-override" ? userId : ownerId,
+ );
+
// Resolve a Vault SSH signer profile (shared settings, no secrets). The
// certificate itself is obtained per-user at connect time via Vault OIDC.
if (host.vaultProfileId && sharedAuthResolution !== "recipient-override") {
diff --git a/src/backend/hosts/host-session-status.test.ts b/src/backend/hosts/host-session-status.test.ts
new file mode 100644
index 000000000..a7fa559d2
--- /dev/null
+++ b/src/backend/hosts/host-session-status.test.ts
@@ -0,0 +1,38 @@
+import { describe, expect, it, vi } from "vitest";
+import { HostSessionStatus } from "./host-session-status.js";
+
+describe("HostSessionStatus", () => {
+ it("reports only the first connection and last disconnection per host", () => {
+ const status = new HostSessionStatus();
+ const listener = vi.fn();
+ status.subscribe(listener);
+
+ const closeFirst = status.register(7);
+ const closeSecond = status.register(7);
+
+ expect(listener).toHaveBeenCalledTimes(1);
+ expect(listener).toHaveBeenLastCalledWith(7, true);
+
+ closeFirst();
+ expect(listener).toHaveBeenCalledTimes(1);
+
+ closeSecond();
+ expect(listener).toHaveBeenLastCalledWith(7, false);
+ expect(listener).toHaveBeenCalledTimes(2);
+ });
+
+ it("makes connection cleanup idempotent", () => {
+ const status = new HostSessionStatus();
+ const listener = vi.fn();
+ status.subscribe(listener);
+
+ const close = status.register(9);
+ close();
+ close();
+
+ expect(listener.mock.calls).toEqual([
+ [9, true],
+ [9, false],
+ ]);
+ });
+});
diff --git a/src/backend/hosts/host-session-status.ts b/src/backend/hosts/host-session-status.ts
new file mode 100644
index 000000000..06a90d2a6
--- /dev/null
+++ b/src/backend/hosts/host-session-status.ts
@@ -0,0 +1,38 @@
+type HostSessionStatusListener = (hostId: number, online: boolean) => void;
+
+export class HostSessionStatus {
+ private counts = new Map();
+ private listeners = new Set();
+
+ register(hostId: number): () => void {
+ const count = this.counts.get(hostId) ?? 0;
+ this.counts.set(hostId, count + 1);
+ if (count === 0) this.emit(hostId, true);
+
+ let active = true;
+ return () => {
+ if (!active) return;
+ active = false;
+
+ const next = (this.counts.get(hostId) ?? 1) - 1;
+ if (next > 0) {
+ this.counts.set(hostId, next);
+ return;
+ }
+
+ this.counts.delete(hostId);
+ this.emit(hostId, false);
+ };
+ }
+
+ subscribe(listener: HostSessionStatusListener): () => void {
+ this.listeners.add(listener);
+ return () => this.listeners.delete(listener);
+ }
+
+ private emit(hostId: number, online: boolean): void {
+ for (const listener of this.listeners) listener(hostId, online);
+ }
+}
+
+export const hostSessionStatus = new HostSessionStatus();
diff --git a/src/backend/hosts/issued-certificate-auth.ts b/src/backend/hosts/issued-certificate-auth.ts
new file mode 100644
index 000000000..b5dccdc55
--- /dev/null
+++ b/src/backend/hosts/issued-certificate-auth.ts
@@ -0,0 +1,12 @@
+/**
+ * Auth types whose SSH certificate is issued on demand through a browser
+ * sign-in and cached per user and host (opkssh_tokens). They share the
+ * whole connect path; only the issuing flow differs.
+ */
+export const ISSUED_CERTIFICATE_AUTH_TYPES = ["opkssh", "stepca"] as const;
+
+export function usesIssuedCertificate(authType: string | null | undefined) {
+ return (ISSUED_CERTIFICATE_AUTH_TYPES as readonly string[]).includes(
+ authType ?? "",
+ );
+}
diff --git a/src/backend/hosts/metrics/automation-bridge.ts b/src/backend/hosts/metrics/automation-bridge.ts
index a1474e784..a3c6fee89 100644
--- a/src/backend/hosts/metrics/automation-bridge.ts
+++ b/src/backend/hosts/metrics/automation-bridge.ts
@@ -6,6 +6,9 @@
* automations layer must never disturb metric collection, and a static import
* would create a cycle (automations reads repositories, which the metrics
* module also pulls in).
+ *
+ * For the generic (non-metrics) internal event notifier, see
+ * `hosts/automation-events.ts` -- that one is shared across features.
*/
import type { MetricsSnapshot } from "../../automations/conditions.js";
@@ -46,17 +49,3 @@ export function notifyAutomationHealthCheck(
)
.catch(() => {});
}
-
-export function notifyAutomationInternalEvent(
- event: string,
- userId: string,
- hostId?: number,
- details?: Record,
-): void {
- if (!userId) return;
- import("../../automations/triggers.js")
- .then((triggers) =>
- triggers.onInternalEvent({ event, userId, hostId, details }),
- )
- .catch(() => {});
-}
diff --git a/src/backend/hosts/metrics/helpers.ts b/src/backend/hosts/metrics/helpers.ts
index bd9eb4cb4..d10b62828 100644
--- a/src/backend/hosts/metrics/helpers.ts
+++ b/src/backend/hosts/metrics/helpers.ts
@@ -1,4 +1,5 @@
import type { Client } from "ssh2";
+import { usesIssuedCertificate } from "../issued-certificate-auth.js";
export type StatsCapableHost = {
connectionType?: string;
@@ -13,7 +14,8 @@ export type TcpPingStatsConfig = {
export function supportsMetrics(host: StatsCapableHost): boolean {
const connectionType = host.connectionType || "ssh";
if (connectionType !== "ssh") return false;
- if (host.authType === "none" || host.authType === "opkssh") return false;
+ if (host.authType === "none" || usesIssuedCertificate(host.authType))
+ return false;
return true;
}
diff --git a/src/backend/hosts/metrics/host-status.test.ts b/src/backend/hosts/metrics/host-status.test.ts
index f41c4544e..83268f3fc 100644
--- a/src/backend/hosts/metrics/host-status.test.ts
+++ b/src/backend/hosts/metrics/host-status.test.ts
@@ -1,9 +1,25 @@
import { describe, expect, it } from "vitest";
import {
+ isHostKeyVerificationError,
statusAfterAuthentication,
statusAfterReachabilityCheck,
} from "./host-status.js";
+describe("isHostKeyVerificationError", () => {
+ it.each([
+ "Host denied (verification failed)",
+ "Host key changed - please connect via Terminal to verify the new key",
+ ])("classifies %s", (message) => {
+ expect(isHostKeyVerificationError(new Error(message))).toBe(true);
+ });
+
+ it("does not classify ordinary authentication failures", () => {
+ expect(isHostKeyVerificationError(new Error("Permission denied"))).toBe(
+ false,
+ );
+ });
+});
+
describe("host availability status", () => {
it("does not call a TCP-reachable host online before authentication", () => {
expect(statusAfterReachabilityCheck(true)).toBe("reachable");
diff --git a/src/backend/hosts/metrics/host-status.ts b/src/backend/hosts/metrics/host-status.ts
index 3c5b39144..066db1f97 100644
--- a/src/backend/hosts/metrics/host-status.ts
+++ b/src/backend/hosts/metrics/host-status.ts
@@ -1,5 +1,13 @@
export type HostStatus = "online" | "reachable" | "offline";
+export function isHostKeyVerificationError(error: unknown): boolean {
+ return (
+ error instanceof Error &&
+ (error.message.includes("Host denied (verification failed)") ||
+ error.message.includes("Host key changed"))
+ );
+}
+
export function statusAfterReachabilityCheck(
reachable: boolean,
current?: HostStatus,
diff --git a/src/backend/hosts/metrics/index.ts b/src/backend/hosts/metrics/index.ts
index 941bdae44..72fe70d51 100644
--- a/src/backend/hosts/metrics/index.ts
+++ b/src/backend/hosts/metrics/index.ts
@@ -1,4 +1,5 @@
import { getErrorMessage } from "../../utils/error-message.js";
+import { usesIssuedCertificate } from "../issued-certificate-auth.js";
import express from "express";
import net from "net";
import { createCorsMiddleware } from "../../utils/cors-config.js";
@@ -34,10 +35,12 @@ import { collectNetworkMetrics } from "./widgets/network-collector.js";
import { collectUptimeMetrics } from "./widgets/uptime-collector.js";
import { collectProcessesMetrics } from "./widgets/processes-collector.js";
import { collectSystemMetrics } from "./widgets/system-collector.js";
+import { detectPlatform } from "./widgets/common-utils.js";
import { collectLoginStats } from "./widgets/login-stats-collector.js";
import { collectPortsMetrics } from "./widgets/ports-collector.js";
import { collectFirewallMetrics } from "./widgets/firewall-collector.js";
import { collectTemperatureMetrics } from "./widgets/temperature-collector.js";
+import { collectGpuMetrics, type GpuMetrics } from "./widgets/gpu-collector.js";
import {
createSocks5Connection,
type SOCKS5Config,
@@ -52,11 +55,14 @@ import { registerHostMetricsHistoryRoutes } from "./history-routes.js";
import { registerProxmoxStatsRoutes } from "./proxmox-stats-routes.js";
import { registerProxmoxStatsHistoryRoutes } from "./proxmox-stats-history-routes.js";
import { ProxmoxPollingManager } from "./proxmox-stats-polling.js";
+// PLUGIN-EVENT: terminal session online/offline -> phase-2 ctx.events "host.session.status" topic
+import { hostSessionStatus } from "../host-session-status.js";
import { AlertEngine } from "./alert-engine.js";
import {
notifyAutomationMetrics,
notifyAutomationStatus,
} from "./automation-bridge.js";
+import { notifyAutomationInternalEvent } from "../automation-events.js";
import { registerManagerRoutes } from "./managers/index.js";
import { resolveSshConnectConfigHost } from "../ssh-dns.js";
import { AccessDeniedError } from "./managers/route-helpers.js";
@@ -71,6 +77,7 @@ import {
} from "./helpers.js";
import {
type HostStatus,
+ isHostKeyVerificationError,
statusAfterAuthentication,
statusAfterReachabilityCheck,
} from "./host-status.js";
@@ -95,6 +102,7 @@ import {
requestQueue,
statusPollLimiter,
} from "./state.js";
+import { listenOnServicePort } from "../../utils/service-listen.js";
const authManager = AuthManager.getInstance();
const permissionManager = PermissionManager.getInstance();
@@ -144,6 +152,7 @@ interface SSHHostWithCredentials {
type StatusEntry = {
status: HostStatus;
lastChecked: string;
+ reason?: "host_key_changed";
};
interface StatsConfig {
@@ -205,13 +214,46 @@ class PollingManager {
private statusInFlight = new Set();
private metricsInFlight = new Set();
private initialMetricsRequested = new Set();
+ private terminalOnlineHosts = new Set();
+ private metricsAuthenticatedHosts = new Set();
+ private unsubscribeHostSessionStatus: () => void;
constructor() {
+ // PLUGIN-EVENT: subscribe to ctx.events.on("host.session.status", ...) once the
+ // phase-2 event bus exists, instead of the hostSessionStatus singleton directly.
+ this.unsubscribeHostSessionStatus = hostSessionStatus.subscribe(
+ (hostId, online) => this.setTerminalSessionOnline(hostId, online),
+ );
this.viewerCleanupInterval = setInterval(() => {
this.cleanupInactiveViewers();
}, 60000);
}
+ private setTerminalSessionOnline(hostId: number, online: boolean): void {
+ if (online) {
+ this.terminalOnlineHosts.add(hostId);
+ const config = this.pollingConfigs.get(hostId);
+ if (config && isTcpPingEnabled(config.statsConfig)) {
+ this.statusStore.set(hostId, {
+ status: "online",
+ lastChecked: new Date().toISOString(),
+ });
+ }
+ return;
+ }
+
+ this.terminalOnlineHosts.delete(hostId);
+ if (
+ !this.metricsAuthenticatedHosts.has(hostId) &&
+ this.statusStore.get(hostId)?.status === "online"
+ ) {
+ this.statusStore.set(hostId, {
+ status: "reachable",
+ lastChecked: new Date().toISOString(),
+ });
+ }
+ }
+
/**
* Keeps poll concurrency matched to how many hosts are actually being
* polled, so a sweep still finishes inside its interval as a fleet grows.
@@ -577,28 +619,26 @@ class PollingManager {
isOnline = await tcpPing(refreshedHost.ip, pingPort, 5000);
}
const config = this.pollingConfigs.get(refreshedHost.id);
- let authenticated: boolean | undefined;
- if (
- isOnline &&
- supportsMetrics(refreshedHost) &&
- !config?.statsConfig.metricsEnabled
- ) {
- try {
- await withSshConnection(refreshedHost, async () => undefined);
- authenticated = true;
- } catch {
- authenticated = false;
- }
- }
+ // Routine status polling is TCP-only. Hosts with metrics disabled
+ // never get a full SSH auth attempt here, since on RADIUS/Duo-backed
+ // devices that fires a live 2FA push every interval with no session
+ // to show for it; those hosts settle at "reachable" rather than
+ // "online", since metrics collection (the only path that
+ // authenticates and can promote a host to "online") never runs for
+ // them.
const statusEntry: StatusEntry = {
status:
- authenticated === undefined
- ? statusAfterReachabilityCheck(
+ isOnline && this.terminalOnlineHosts.has(refreshedHost.id)
+ ? "online"
+ : statusAfterReachabilityCheck(
isOnline,
this.statusStore.get(refreshedHost.id)?.status,
- )
- : statusAfterAuthentication(authenticated),
+ ),
lastChecked: new Date().toISOString(),
+ ...(isOnline &&
+ this.statusStore.get(refreshedHost.id)?.reason === "host_key_changed"
+ ? { reason: "host_key_changed" as const }
+ : {}),
};
this.statusStore.set(refreshedHost.id, statusEntry);
if (isOnline && this.activeViewers.has(refreshedHost.id)) {
@@ -659,6 +699,7 @@ class PollingManager {
try {
const metrics = await collectMetrics(refreshedHost, () => {
authenticated = true;
+ this.metricsAuthenticatedHosts.add(refreshedHost.id);
this.statusStore.set(refreshedHost.id, {
status: statusAfterAuthentication(true),
lastChecked: new Date().toISOString(),
@@ -680,13 +721,18 @@ class PollingManager {
pollingBackoff.reset(refreshedHost.id);
authFailureTracker.reset(refreshedHost.id);
} catch (error) {
+ const hostKeyChanged = isHostKeyVerificationError(error);
if (!authenticated) {
+ this.metricsAuthenticatedHosts.delete(refreshedHost.id);
this.statusStore.set(refreshedHost.id, {
- status: statusAfterAuthentication(
- false,
- this.statusStore.get(refreshedHost.id)?.status,
- ),
+ status: this.terminalOnlineHosts.has(refreshedHost.id)
+ ? "online"
+ : statusAfterAuthentication(
+ false,
+ this.statusStore.get(refreshedHost.id)?.status,
+ ),
lastChecked: new Date().toISOString(),
+ ...(hostKeyChanged ? { reason: "host_key_changed" as const } : {}),
});
}
const isAuthError =
@@ -709,6 +755,19 @@ class PollingManager {
return;
}
+ if (hostKeyChanged) {
+ authFailureTracker.recordFailure(refreshedHost.id, "HOST_KEY", true);
+ statsLogger.error(
+ "Stats collector host key verification failed",
+ error,
+ {
+ operation: "stats_host_key_verification_failed",
+ hostId: refreshedHost.id,
+ },
+ );
+ return;
+ }
+
pollingBackoff.recordFailure(refreshedHost.id);
// Only log when a new retry window opens, not on every skipped poll
@@ -981,6 +1040,7 @@ class PollingManager {
}
destroy(): void {
+ this.unsubscribeHostSessionStatus();
clearInterval(this.viewerCleanupInterval);
for (const hostId of this.pollingConfigs.keys()) {
this.stopPollingForHost(hostId);
@@ -1003,6 +1063,7 @@ function validateHostId(
}
const app = express();
+app.set("trust proxy", "loopback");
app.use(createCompressionMiddleware());
app.use(createCorsMiddleware());
app.use(cookieParser());
@@ -1038,6 +1099,10 @@ app.post("/internal/login-alert", async (req, res) => {
sshUser: string;
fromIp: string;
};
+ notifyAutomationInternalEvent("user_login", userId, hostId, {
+ sshUser,
+ fromIp,
+ });
AlertEngine.getInstance()
.evaluateUserLogin(hostId, userId, sshUser, fromIp)
.catch(() => {});
@@ -1391,7 +1456,7 @@ async function buildSshConfig(
host.authType === "warpgate"
) {
// no credentials needed
- } else if (host.authType === "opkssh") {
+ } else if (usesIssuedCertificate(host.authType)) {
// cert auth setup happens in createSshFactory (needs client instance)
} else if (host.authType === "vault") {
// cert auth setup happens in createSshFactory (needs client instance)
@@ -1435,7 +1500,7 @@ function createSshFactory(host: SSHHostWithCredentials): () => Promise {
const client = new Client();
// Set up OPKSSH cert auth if needed (requires client instance)
- if (host.authType === "opkssh" && host.userId) {
+ if (usesIssuedCertificate(host.authType) && host.userId) {
const { getOPKSSHToken } = await import("../opkssh-auth.js");
const token = await getOPKSSHToken(host.userId, host.id);
if (!token) {
@@ -1705,17 +1770,19 @@ async function collectMetrics(
const collectFn = async (client: Client) => {
onAuthenticated?.();
- const cpu = await collectCpuMetrics(client);
- const memory = await collectMemoryMetrics(client);
+ const platform = await detectPlatform(client);
+ const cpu = await collectCpuMetrics(client, platform);
+ const memory = await collectMemoryMetrics(client, platform);
const disk = await collectDiskMetrics(
client,
excludedMounts,
monitoredMounts,
+ platform,
);
- const network = await collectNetworkMetrics(client);
- const uptime = await collectUptimeMetrics(client);
+ const network = await collectNetworkMetrics(client, platform);
+ const uptime = await collectUptimeMetrics(client, platform);
const processes = await collectProcessesMetrics(client);
- const system = await collectSystemMetrics(client);
+ const system = await collectSystemMetrics(client, platform);
let login_stats = {
recentLogins: [],
@@ -1794,6 +1861,13 @@ async function collectMetrics(
// expected
}
+ let gpu: GpuMetrics = { source: "none", gpus: [], processes: [] };
+ try {
+ gpu = await collectGpuMetrics(client);
+ } catch {
+ // expected
+ }
+
const result = {
cpu,
memory,
@@ -1806,6 +1880,7 @@ async function collectMetrics(
ports,
firewall,
temperature,
+ gpu,
};
metricsCache.set(host.id, result);
@@ -1835,6 +1910,8 @@ async function collectMetrics(
error.message.includes("Invalid SSH key format")
) {
authFailureTracker.recordFailure(host.id, "AUTH", true);
+ } else if (isHostKeyVerificationError(error)) {
+ authFailureTracker.recordFailure(host.id, "HOST_KEY", true);
} else if (
error.message.includes("authentication") ||
error.message.includes("Permission denied") ||
@@ -2354,7 +2431,7 @@ app.post("/metrics/start/:id", validateHostId, async (req, res) => {
const config = await buildSshConfig(host);
const client = new Client();
- if (host.authType === "opkssh" && host.userId) {
+ if (usesIssuedCertificate(host.authType) && host.userId) {
const { getOPKSSHToken } = await import("../opkssh-auth.js");
const token = await getOPKSSHToken(host.userId, host.id);
if (!token) {
@@ -3070,20 +3147,26 @@ process.on("SIGTERM", () => {
});
const PORT = 30005;
-app.listen(PORT, async () => {
- try {
- await authManager.initialize();
- } catch (err) {
- statsLogger.error("Failed to initialize AuthManager", err, {
- operation: "auth_init_error",
- });
- }
+listenOnServicePort({
+ app,
+ port: PORT,
+ logger: statsLogger,
+ serviceName: "metrics",
+ onListening: async () => {
+ try {
+ await authManager.initialize();
+ } catch (err) {
+ statsLogger.error("Failed to initialize AuthManager", err, {
+ operation: "auth_init_error",
+ });
+ }
- setInterval(
- () => {
- authFailureTracker.cleanup();
- pollingBackoff.cleanup();
- },
- 10 * 60 * 1000,
- );
+ setInterval(
+ () => {
+ authFailureTracker.cleanup();
+ pollingBackoff.cleanup();
+ },
+ 10 * 60 * 1000,
+ );
+ },
});
diff --git a/src/backend/hosts/metrics/state.ts b/src/backend/hosts/metrics/state.ts
index 3ccd8cf07..9cec72c49 100644
--- a/src/backend/hosts/metrics/state.ts
+++ b/src/backend/hosts/metrics/state.ts
@@ -97,7 +97,7 @@ class MetricsCache {
interface AuthFailureRecord {
count: number;
lastFailure: number;
- reason: "TOTP" | "AUTH" | "TIMEOUT";
+ reason: "TOTP" | "AUTH" | "TIMEOUT" | "HOST_KEY";
permanent: boolean;
}
@@ -108,7 +108,7 @@ class AuthFailureTracker {
recordFailure(
hostId: number,
- reason: "TOTP" | "AUTH" | "TIMEOUT",
+ reason: "TOTP" | "AUTH" | "TIMEOUT" | "HOST_KEY",
permanent = false,
): void {
const existing = this.failures.get(hostId);
@@ -153,6 +153,10 @@ class AuthFailureTracker {
return "TOTP authentication required (metrics unavailable)";
}
+ if (record.reason === "HOST_KEY") {
+ return "SSH host key changed (verification required)";
+ }
+
if (record.permanent) {
return "Authentication permanently failed";
}
@@ -172,6 +176,10 @@ class AuthFailureTracker {
return null;
}
+ resetHostKeyFailure(hostId: number): void {
+ if (this.failures.get(hostId)?.reason === "HOST_KEY") this.reset(hostId);
+ }
+
reset(hostId: number): void {
this.failures.delete(hostId);
}
diff --git a/src/backend/hosts/metrics/widgets/common-utils.ts b/src/backend/hosts/metrics/widgets/common-utils.ts
index 66361aed3..1d536fe57 100644
--- a/src/backend/hosts/metrics/widgets/common-utils.ts
+++ b/src/backend/hosts/metrics/widgets/common-utils.ts
@@ -88,6 +88,50 @@ export function execCommand(
});
}
+export type HostPlatform = "darwin" | "linux" | "windows" | "other";
+
+// Windows OpenSSH's default shell is usually cmd.exe (occasionally
+// PowerShell), so scripts are sent base64-encoded via -EncodedCommand -
+// that avoids every cmd.exe quoting/escaping pitfall entirely, since the
+// argument ends up being plain alphanumeric text with no shell metacharacters.
+export function encodePowerShellCommand(script: string): string {
+ return Buffer.from(script, "utf16le").toString("base64");
+}
+
+export function execPowerShell(
+ client: Client,
+ script: string,
+ timeoutMs = 30000,
+): Promise<{ stdout: string; stderr: string; code: number | null }> {
+ const encoded = encodePowerShellCommand(script);
+ return execCommand(
+ client,
+ `powershell -NoProfile -NonInteractive -EncodedCommand ${encoded}`,
+ timeoutMs,
+ );
+}
+
+export async function detectPlatform(client: Client): Promise {
+ try {
+ const { stdout, code } = await execCommand(client, "uname -s", 10000);
+ const kernel = stdout.trim().toLowerCase();
+ if (kernel === "darwin") return "darwin";
+ if (kernel === "linux") return "linux";
+ if (code === 0 && kernel) return "other";
+ } catch {
+ // expected on hosts with no POSIX shell (e.g. Windows via cmd.exe)
+ }
+
+ try {
+ const { stdout } = await execPowerShell(client, "'WIN_OK'", 10000);
+ if (stdout.includes("WIN_OK")) return "windows";
+ } catch {
+ // expected on hosts with no PowerShell available
+ }
+
+ return "other";
+}
+
export function toFixedNum(
n: number | null | undefined,
digits = 2,
diff --git a/src/backend/hosts/metrics/widgets/cpu-collector.ts b/src/backend/hosts/metrics/widgets/cpu-collector.ts
index 87a6a96d6..83d523c2d 100644
--- a/src/backend/hosts/metrics/widgets/cpu-collector.ts
+++ b/src/backend/hosts/metrics/widgets/cpu-collector.ts
@@ -1,5 +1,10 @@
import type { Client } from "ssh2";
-import { execCommand, toFixedNum } from "./common-utils.js";
+import {
+ execCommand,
+ execPowerShell,
+ toFixedNum,
+ type HostPlatform,
+} from "./common-utils.js";
export function parseCpuLine(
cpuLine: string,
@@ -16,7 +21,22 @@ export function parseCpuLine(
return { total, idle };
}
-export async function collectCpuMetrics(client: Client): Promise<{
+// Parses macOS `top -l 1 -n 0` output, e.g.
+// "CPU usage: 12.34% user, 5.67% sys, 81.99% idle"
+export function parseDarwinCpuUsageLine(
+ line: string,
+): { percent: number } | undefined {
+ const match = line.match(
+ /([\d.]+)%\s*user,\s*([\d.]+)%\s*sys,\s*([\d.]+)%\s*idle/i,
+ );
+ if (!match) return undefined;
+ const user = Number(match[1]);
+ const sys = Number(match[2]);
+ if (!Number.isFinite(user) || !Number.isFinite(sys)) return undefined;
+ return { percent: Math.max(0, Math.min(100, user + sys)) };
+}
+
+async function collectDarwinCpuMetrics(client: Client): Promise<{
percent: number | null;
cores: number | null;
load: [number, number, number] | null;
@@ -25,6 +45,107 @@ export async function collectCpuMetrics(client: Client): Promise<{
let cores: number | null = null;
let loadTriplet: [number, number, number] | null = null;
+ try {
+ const [topOut, coresOut, loadOut] = await Promise.race([
+ Promise.all([
+ execCommand(client, "top -l 1 -n 0"),
+ execCommand(client, "sysctl -n hw.ncpu"),
+ execCommand(client, "sysctl -n vm.loadavg"),
+ ]),
+ new Promise((_, reject) =>
+ setTimeout(
+ () => reject(new Error("CPU metrics collection timeout")),
+ 25000,
+ ),
+ ),
+ ]);
+
+ const usageLine = topOut.stdout
+ .split("\n")
+ .find((l) => l.includes("CPU usage:"));
+ const parsed = usageLine ? parseDarwinCpuUsageLine(usageLine) : undefined;
+ if (parsed) cpuPercent = parsed.percent;
+
+ const coresNum = Number((coresOut.stdout || "").trim());
+ cores = Number.isFinite(coresNum) && coresNum > 0 ? coresNum : null;
+
+ // sysctl -n vm.loadavg -> "{ 1.23 1.45 1.67 }"
+ const loadMatch = loadOut.stdout.match(/([\d.]+)\s+([\d.]+)\s+([\d.]+)/);
+ if (loadMatch) {
+ loadTriplet = [
+ Number(loadMatch[1]),
+ Number(loadMatch[2]),
+ Number(loadMatch[3]),
+ ].map((v) => (Number.isFinite(v) ? Number(v) : 0)) as [
+ number,
+ number,
+ number,
+ ];
+ }
+ } catch {
+ cpuPercent = null;
+ loadTriplet = null;
+ }
+
+ return {
+ percent: toFixedNum(cpuPercent, 0),
+ cores,
+ load: loadTriplet,
+ };
+}
+
+// No POSIX-style load average exists on Windows, so `load` always stays null.
+async function collectWindowsCpuMetrics(client: Client): Promise<{
+ percent: number | null;
+ cores: number | null;
+ load: [number, number, number] | null;
+}> {
+ let cpuPercent: number | null = null;
+ let cores: number | null = null;
+
+ try {
+ const { stdout } = await execPowerShell(
+ client,
+ "$cpu=(Get-CimInstance Win32_Processor | Measure-Object -Property LoadPercentage -Average).Average; $cores=(Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors; [PSCustomObject]@{cpu=$cpu; cores=$cores} | ConvertTo-Json -Compress",
+ 25000,
+ );
+ const parsed = JSON.parse(stdout.trim());
+ const cpuNum = Number(parsed?.cpu);
+ const coresNum = Number(parsed?.cores);
+ cpuPercent = Number.isFinite(cpuNum)
+ ? Math.max(0, Math.min(100, cpuNum))
+ : null;
+ cores = Number.isFinite(coresNum) && coresNum > 0 ? coresNum : null;
+ } catch {
+ cpuPercent = null;
+ }
+
+ return {
+ percent: toFixedNum(cpuPercent, 0),
+ cores,
+ load: null,
+ };
+}
+
+export async function collectCpuMetrics(
+ client: Client,
+ platform?: HostPlatform,
+): Promise<{
+ percent: number | null;
+ cores: number | null;
+ load: [number, number, number] | null;
+}> {
+ if (platform === "darwin") {
+ return collectDarwinCpuMetrics(client);
+ }
+ if (platform === "windows") {
+ return collectWindowsCpuMetrics(client);
+ }
+
+ let cpuPercent: number | null = null;
+ let cores: number | null = null;
+ let loadTriplet: [number, number, number] | null = null;
+
try {
const [stat1, loadAvgOut, coresOut] = await Promise.race([
Promise.all([
diff --git a/src/backend/hosts/metrics/widgets/disk-collector.ts b/src/backend/hosts/metrics/widgets/disk-collector.ts
index abeb40504..13f6b9508 100644
--- a/src/backend/hosts/metrics/widgets/disk-collector.ts
+++ b/src/backend/hosts/metrics/widgets/disk-collector.ts
@@ -1,5 +1,10 @@
import type { Client } from "ssh2";
-import { execCommand, toFixedNum } from "./common-utils.js";
+import {
+ execCommand,
+ execPowerShell,
+ toFixedNum,
+ type HostPlatform,
+} from "./common-utils.js";
const PSEUDO_FS_RE = /^(tmpfs|devtmpfs|overlay|udev|none|shm)$/;
@@ -54,8 +59,8 @@ export function parseDfLines(output: string): DfRow[] {
.filter((row) => row.parts.length >= 7 && !PSEUDO_FS_RE.test(row.type));
}
-// Finds the index of the most-utilized real filesystem in a `df -T -B1`-style
-// row set (parts[2] = total bytes, parts[3] = used bytes), so a nearly-full
+// Finds the index of the most-utilized real filesystem in a GNU `df -TkP`-style
+// row set (parts[2] = total KB, parts[3] = used KB), so a nearly-full
// secondary mount (e.g. /data) isn't hidden behind a healthy root filesystem.
export function findWorstMountIndex(bytesRows: DfRow[]): {
index: number;
@@ -93,20 +98,22 @@ export function findWorstMountIndex(bytesRows: DfRow[]): {
};
}
-// Merges the `df -T -B1` and `df -T -h` row sets into one filesystem list.
-// Byte rows drive the maths; human rows only supply the display strings,
-// matched by mount point so a mismatched row count can't shift the columns.
+// Merges a GNU `df -TkP` size-row set (parts[2..4] in `blockSizeBytes` units)
+// and a `df -hT -P` human-row set into one filesystem list. Byte rows drive
+// the maths; human rows only supply the display strings, matched by mount
+// point so a mismatched row count can't shift the columns.
export function buildFilesystemList(
bytesRows: DfRow[],
humanRows: DfRow[],
+ blockSizeBytes = 1,
): DiskFilesystem[] {
const aligned = humanRows.length === bytesRows.length;
return bytesRows
.map((row, index) => {
- const totalBytes = Number(row.parts[2]);
- const usedBytes = Number(row.parts[3]);
- const availableBytes = Number(row.parts[4]);
+ const totalBytes = Number(row.parts[2]) * blockSizeBytes;
+ const usedBytes = Number(row.parts[3]) * blockSizeBytes;
+ const availableBytes = Number(row.parts[4]) * blockSizeBytes;
if (!Number.isFinite(totalBytes) || totalBytes <= 0) return null;
const humanRow = aligned
@@ -202,7 +209,88 @@ export function mergeMonitoredFilesystems(
return result;
}
-export async function collectDiskMetrics(
+function humanizeBytes(bytes: number): string {
+ const units = ["B", "K", "M", "G", "T", "P"];
+ let value = Math.max(0, bytes);
+ let unitIndex = 0;
+ while (value >= 1024 && unitIndex < units.length - 1) {
+ value /= 1024;
+ unitIndex++;
+ }
+ const rounded =
+ unitIndex > 0 && value < 10 ? value.toFixed(1) : Math.round(value);
+ return `${rounded}${units[unitIndex]}`;
+}
+
+// BSD/macOS `df -T` takes a filesystem-type argument to *filter* by, unlike
+// GNU `df -T` which *prints* a type column - so macOS needs its own command
+// (`df -Pk`, no type column) and gets the type separately from `mount`.
+const DARWIN_SKIP_MOUNT_RE =
+ /^\/System\/Volumes\/(VM|Preboot|Update|xarts|iSCPreboot|Hardware)(\/|$)/;
+const DARWIN_SKIP_TYPE_RE = /^(devfs|autofs)$/;
+
+export function parseDarwinMountTypes(output: string): Map {
+ const map = new Map();
+ for (const line of output.split("\n")) {
+ // Device names can contain spaces (e.g. autofs's "map auto_home"), so
+ // match the literal " on " / " (" separators rather than a single token.
+ const match = line.match(/^.+? on (.+?) \(([^,)]+)/);
+ if (match) map.set(match[1], match[2].trim());
+ }
+ return map;
+}
+
+export function parseDarwinDfRows(
+ output: string,
+ typeByMount: Map,
+): DiskFilesystem[] {
+ return output
+ .split("\n")
+ .map((l) => l.trim())
+ .filter(Boolean)
+ .map((line) => {
+ const parts = line.split(/\s+/);
+ if (parts.length < 6) return null;
+
+ const filesystem = parts[0];
+ const totalKb = Number(parts[1]);
+ const usedKb = Number(parts[2]);
+ const availableKb = Number(parts[3]);
+ const mount = parts.slice(5).join(" ");
+ if (!Number.isFinite(totalKb) || totalKb <= 0) return null;
+ if (DARWIN_SKIP_MOUNT_RE.test(mount)) return null;
+
+ const type = typeByMount.get(mount) || "";
+ if (DARWIN_SKIP_TYPE_RE.test(type)) return null;
+
+ const totalBytes = totalKb * 1024;
+ const usedBytes = Number.isFinite(usedKb) ? usedKb * 1024 : null;
+ const availableBytes = Number.isFinite(availableKb)
+ ? availableKb * 1024
+ : null;
+ const percent =
+ usedBytes !== null
+ ? Math.max(0, Math.min(100, (usedBytes / totalBytes) * 100))
+ : null;
+
+ return {
+ filesystem,
+ type,
+ mount,
+ percent: toFixedNum(percent, 0),
+ usedHuman: usedBytes !== null ? humanizeBytes(usedBytes) : null,
+ totalHuman: humanizeBytes(totalBytes),
+ availableHuman:
+ availableBytes !== null ? humanizeBytes(availableBytes) : null,
+ usedBytes,
+ totalBytes,
+ availableBytes,
+ };
+ })
+ .filter((fs): fs is DiskFilesystem => fs !== null);
+}
+
+async function collectDarwinDiskMetrics(
client: Client,
excludedMounts?: string[] | null,
monitoredMounts?: MonitoredMount[] | null,
@@ -214,15 +302,180 @@ export async function collectDiskMetrics(
mount: string | null;
filesystems: DiskFilesystem[];
}> {
+ try {
+ const [dfOut, mountOut] = await Promise.all([
+ execCommand(client, "df -Pk | tail -n +2"),
+ execCommand(client, "mount"),
+ ]);
+
+ const typeByMount = parseDarwinMountTypes(mountOut.stdout);
+ let detected = parseDarwinDfRows(dfOut.stdout, typeByMount);
+
+ const monitored = (monitoredMounts ?? []).filter((entry) =>
+ Boolean(entry.path.trim()),
+ );
+ if (monitored.length > 0) {
+ const customFilesystems = await Promise.all(
+ monitored.map(async (entry) => {
+ const path = shellQuote(entry.path.trim());
+ try {
+ const custom = await execCommand(
+ client,
+ `df -Pk -- ${path} | tail -n +2`,
+ );
+ return parseDarwinDfRows(custom.stdout, typeByMount)[0] ?? null;
+ } catch {
+ return null;
+ }
+ }),
+ );
+ detected = mergeMonitoredFilesystems(
+ detected,
+ monitored,
+ customFilesystems,
+ );
+ }
+
+ const filesystems = filterExcludedFilesystems(detected, excludedMounts);
+ const primary = selectPrimaryFilesystem(filesystems);
+
+ return {
+ percent: primary?.percent ?? null,
+ usedHuman: primary?.usedHuman ?? null,
+ totalHuman: primary?.totalHuman ?? null,
+ availableHuman: primary?.availableHuman ?? null,
+ mount: primary?.mount ?? null,
+ filesystems,
+ };
+ } catch {
+ return {
+ percent: null,
+ usedHuman: null,
+ totalHuman: null,
+ availableHuman: null,
+ mount: null,
+ filesystems: [],
+ };
+ }
+}
+
+interface WindowsDiskRow {
+ drive: string;
+ total: number;
+ free: number;
+}
+
+const WINDOWS_DISK_SCRIPT =
+ 'Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | ForEach-Object {' +
+ " [PSCustomObject]@{drive=$_.DeviceID; total=$_.Size; free=$_.FreeSpace}" +
+ " } | ConvertTo-Json -Compress";
+
+export function parseWindowsDiskJson(output: string): WindowsDiskRow[] {
+ const trimmed = output.trim();
+ if (!trimmed) return [];
+ try {
+ const parsed = JSON.parse(trimmed);
+ const rows = Array.isArray(parsed) ? parsed : [parsed];
+ return rows
+ .filter((row): row is Record => Boolean(row?.drive))
+ .map((row) => ({
+ drive: String(row.drive),
+ total: Number(row.total),
+ free: Number(row.free),
+ }))
+ .filter((row) => Number.isFinite(row.total) && row.total > 0);
+ } catch {
+ return [];
+ }
+}
+
+async function collectWindowsDiskMetrics(
+ client: Client,
+ excludedMounts?: string[] | null,
+): Promise<{
+ percent: number | null;
+ usedHuman: string | null;
+ totalHuman: string | null;
+ availableHuman: string | null;
+ mount: string | null;
+ filesystems: DiskFilesystem[];
+}> {
+ try {
+ const { stdout } = await execPowerShell(client, WINDOWS_DISK_SCRIPT);
+ const rows = parseWindowsDiskJson(stdout);
+
+ const filesystems: DiskFilesystem[] = rows.map((row) => {
+ const usedBytes = row.total - row.free;
+ const percent = Math.max(0, Math.min(100, (usedBytes / row.total) * 100));
+ return {
+ filesystem: row.drive,
+ type: "NTFS",
+ mount: row.drive,
+ percent: toFixedNum(percent, 0),
+ usedHuman: humanizeBytes(usedBytes),
+ totalHuman: humanizeBytes(row.total),
+ availableHuman: humanizeBytes(row.free),
+ usedBytes,
+ totalBytes: row.total,
+ availableBytes: row.free,
+ };
+ });
+
+ const filtered = filterExcludedFilesystems(filesystems, excludedMounts);
+ const primary =
+ filtered.find((fs) => fs.mount.toUpperCase().startsWith("C")) ??
+ filtered[0] ??
+ null;
+
+ return {
+ percent: primary?.percent ?? null,
+ usedHuman: primary?.usedHuman ?? null,
+ totalHuman: primary?.totalHuman ?? null,
+ availableHuman: primary?.availableHuman ?? null,
+ mount: primary?.mount ?? null,
+ filesystems: filtered,
+ };
+ } catch {
+ return {
+ percent: null,
+ usedHuman: null,
+ totalHuman: null,
+ availableHuman: null,
+ mount: null,
+ filesystems: [],
+ };
+ }
+}
+
+export async function collectDiskMetrics(
+ client: Client,
+ excludedMounts?: string[] | null,
+ monitoredMounts?: MonitoredMount[] | null,
+ platform?: HostPlatform,
+): Promise<{
+ percent: number | null;
+ usedHuman: string | null;
+ totalHuman: string | null;
+ availableHuman: string | null;
+ mount: string | null;
+ filesystems: DiskFilesystem[];
+}> {
+ if (platform === "windows") {
+ return collectWindowsDiskMetrics(client, excludedMounts);
+ }
+ if (platform === "darwin") {
+ return collectDarwinDiskMetrics(client, excludedMounts, monitoredMounts);
+ }
+
try {
const [diskOutHuman, diskOutBytes] = await Promise.all([
execCommand(client, "df -hT -P | tail -n +2"),
- execCommand(client, "df -TB1 -P | tail -n +2"),
+ execCommand(client, "df -TkP | tail -n +2"),
]);
const humanRows = parseDfLines(diskOutHuman.stdout);
const bytesRows = parseDfLines(diskOutBytes.stdout);
- let detected = buildFilesystemList(bytesRows, humanRows);
+ let detected = buildFilesystemList(bytesRows, humanRows, 1024);
const monitored = (monitoredMounts ?? []).filter((entry) =>
Boolean(entry.path.trim()),
);
@@ -233,12 +486,13 @@ export async function collectDiskMetrics(
try {
const [customHuman, customBytes] = await Promise.all([
execCommand(client, `df -hT -P -- ${path} | tail -n +2`),
- execCommand(client, `df -TB1 -P -- ${path} | tail -n +2`),
+ execCommand(client, `df -TkP -- ${path} | tail -n +2`),
]);
return (
buildFilesystemList(
parseDfLines(customBytes.stdout),
parseDfLines(customHuman.stdout),
+ 1024,
)[0] ?? null
);
} catch {
diff --git a/src/backend/hosts/metrics/widgets/gpu-collector.ts b/src/backend/hosts/metrics/widgets/gpu-collector.ts
new file mode 100644
index 000000000..cc5f1bc82
--- /dev/null
+++ b/src/backend/hosts/metrics/widgets/gpu-collector.ts
@@ -0,0 +1,186 @@
+import type { Client } from "ssh2";
+import { execCommand, toFixedNum } from "./common-utils.js";
+
+export interface GpuDevice {
+ index: number;
+ uuid: string;
+ name: string;
+ driverVersion: string | null;
+ utilizationPercent: number | null;
+ memoryUsedMiB: number | null;
+ memoryTotalMiB: number | null;
+ memoryPercent: number | null;
+ temperatureCelsius: number | null;
+ powerDrawWatts: number | null;
+ powerLimitWatts: number | null;
+ fanPercent: number | null;
+}
+
+export interface GpuProcess {
+ /** Null when nvidia-smi reports a uuid that matches none of the listed GPUs. */
+ gpuIndex: number | null;
+ pid: number;
+ name: string;
+ memoryUsedMiB: number | null;
+}
+
+export interface GpuMetrics {
+ source: "nvidia-smi" | "none";
+ gpus: GpuDevice[];
+ processes: GpuProcess[];
+}
+
+const SECTION_SEPARATOR = "---";
+
+// The free-text name is queried last so commas inside it cannot shift the
+// numeric columns; the parsers rejoin everything past the fixed fields.
+const GPU_QUERY_FIELDS = [
+ "index",
+ "uuid",
+ "driver_version",
+ "utilization.gpu",
+ "memory.used",
+ "memory.total",
+ "temperature.gpu",
+ "power.draw",
+ "power.limit",
+ "fan.speed",
+ "name",
+];
+const APPS_QUERY_FIELDS = ["gpu_uuid", "pid", "used_memory", "process_name"];
+
+const NVIDIA_SMI_COMMAND = [
+ "command -v nvidia-smi >/dev/null 2>&1 || exit 0;",
+ `nvidia-smi --query-gpu=${GPU_QUERY_FIELDS.join(",")} --format=csv,noheader,nounits 2>/dev/null;`,
+ `echo ${SECTION_SEPARATOR};`,
+ `nvidia-smi --query-compute-apps=${APPS_QUERY_FIELDS.join(",")} --format=csv,noheader,nounits 2>/dev/null`,
+].join(" ");
+
+const NO_GPU: GpuMetrics = { source: "none", gpus: [], processes: [] };
+
+/** Reads a numeric field; nvidia-smi writes "[N/A]", "[Not Supported]" etc. for missing ones. */
+function parseReading(raw: string | undefined, digits = 1): number | null {
+ const value = raw?.trim();
+ if (!value || value.startsWith("[")) return null;
+ return toFixedNum(Number(value), digits);
+}
+
+function parseInteger(raw: string | undefined): number | null {
+ const value = raw?.trim();
+ return value && /^\d+$/.test(value) ? Number(value) : null;
+}
+
+function splitCsvRow(line: string, fixedFields: number): string[] | null {
+ const parts = line.split(",").map((part) => part.trim());
+ if (parts.length <= fixedFields) return null;
+ return [...parts.slice(0, fixedFields), parts.slice(fixedFields).join(", ")];
+}
+
+export function parseNvidiaSmiGpus(output: string): GpuDevice[] {
+ const fixedFields = GPU_QUERY_FIELDS.length - 1;
+ const gpus: GpuDevice[] = [];
+
+ for (const line of output.split("\n")) {
+ const row = splitCsvRow(line, fixedFields);
+ if (!row) continue;
+
+ const [
+ rawIndex,
+ uuid,
+ driverVersion,
+ utilization,
+ memoryUsed,
+ memoryTotal,
+ temperature,
+ powerDraw,
+ powerLimit,
+ fan,
+ name,
+ ] = row;
+ const index = parseInteger(rawIndex);
+ if (index === null || !uuid) continue;
+
+ const memoryUsedMiB = parseReading(memoryUsed, 0);
+ const memoryTotalMiB = parseReading(memoryTotal, 0);
+
+ gpus.push({
+ index,
+ uuid,
+ name,
+ driverVersion:
+ driverVersion && !driverVersion.startsWith("[") ? driverVersion : null,
+ utilizationPercent: parseReading(utilization),
+ memoryUsedMiB,
+ memoryTotalMiB,
+ memoryPercent:
+ memoryUsedMiB !== null &&
+ memoryTotalMiB !== null &&
+ memoryTotalMiB !== 0
+ ? toFixedNum((memoryUsedMiB / memoryTotalMiB) * 100, 1)
+ : null,
+ temperatureCelsius: parseReading(temperature),
+ powerDrawWatts: parseReading(powerDraw),
+ powerLimitWatts: parseReading(powerLimit),
+ fanPercent: parseReading(fan),
+ });
+ }
+
+ return gpus;
+}
+
+export function parseNvidiaSmiProcesses(
+ output: string,
+ gpus: GpuDevice[],
+): GpuProcess[] {
+ const indexByUuid = new Map(gpus.map((gpu) => [gpu.uuid, gpu.index]));
+ const processes: GpuProcess[] = [];
+
+ for (const line of output.split("\n")) {
+ const row = splitCsvRow(line, APPS_QUERY_FIELDS.length - 1);
+ if (!row) continue;
+
+ const [uuid, rawPid, memoryUsed, name] = row;
+ const pid = parseInteger(rawPid);
+ if (pid === null) continue;
+
+ processes.push({
+ gpuIndex: indexByUuid.get(uuid) ?? null,
+ pid,
+ name,
+ memoryUsedMiB: parseReading(memoryUsed, 0),
+ });
+ }
+
+ return processes;
+}
+
+export function parseNvidiaSmiOutput(stdout: string): GpuMetrics {
+ const lines = stdout.split("\n");
+ const separator = lines.findIndex(
+ (line) => line.trim() === SECTION_SEPARATOR,
+ );
+ const gpuSection =
+ separator === -1 ? stdout : lines.slice(0, separator).join("\n");
+ const appsSection =
+ separator === -1 ? "" : lines.slice(separator + 1).join("\n");
+
+ const gpus = parseNvidiaSmiGpus(gpuSection);
+ if (gpus.length === 0) return NO_GPU;
+
+ return {
+ source: "nvidia-smi",
+ gpus,
+ processes: parseNvidiaSmiProcesses(appsSection, gpus),
+ };
+}
+
+export async function collectGpuMetrics(client: Client): Promise {
+ try {
+ // nvidia-smi can take a few seconds on hosts without persistence mode.
+ const result = await execCommand(client, NVIDIA_SMI_COMMAND, 15000);
+ return parseNvidiaSmiOutput(result.stdout);
+ } catch {
+ // expected when the host has no NVIDIA driver or the query times out
+ return NO_GPU;
+ }
+}
diff --git a/src/backend/hosts/metrics/widgets/memory-collector.ts b/src/backend/hosts/metrics/widgets/memory-collector.ts
index e25652f5d..bd60bcfee 100644
--- a/src/backend/hosts/metrics/widgets/memory-collector.ts
+++ b/src/backend/hosts/metrics/widgets/memory-collector.ts
@@ -1,7 +1,13 @@
import type { Client } from "ssh2";
-import { execCommand, toFixedNum, kibToGiB } from "./common-utils.js";
+import {
+ execCommand,
+ execPowerShell,
+ toFixedNum,
+ kibToGiB,
+ type HostPlatform,
+} from "./common-utils.js";
-export async function collectMemoryMetrics(client: Client): Promise<{
+async function collectDarwinMemoryMetrics(client: Client): Promise<{
percent: number | null;
usedGiB: number | null;
totalGiB: number | null;
@@ -10,6 +16,110 @@ export async function collectMemoryMetrics(client: Client): Promise<{
let usedGiB: number | null = null;
let totalGiB: number | null = null;
+ try {
+ const [vmStatOut, memSizeOut] = await Promise.all([
+ execCommand(client, "vm_stat"),
+ execCommand(client, "sysctl -n hw.memsize"),
+ ]);
+
+ const totalBytes = Number((memSizeOut.stdout || "").trim());
+ const pageSizeMatch = vmStatOut.stdout.match(/page size of (\d+) bytes/);
+ const pageSize = pageSizeMatch ? Number(pageSizeMatch[1]) : 4096;
+
+ const getPages = (key: string): number | null => {
+ const line = vmStatOut.stdout
+ .split("\n")
+ .find((l) => l.trim().startsWith(key));
+ if (!line) return null;
+ const m = line.match(/(\d+)\./);
+ return m ? Number(m[1]) : null;
+ };
+
+ const active = getPages("Pages active");
+ const wired = getPages("Pages wired down");
+ const compressed = getPages("Pages occupied by compressor");
+
+ if (
+ Number.isFinite(totalBytes) &&
+ totalBytes > 0 &&
+ active !== null &&
+ wired !== null
+ ) {
+ const usedPages = active + wired + (compressed ?? 0);
+ const usedBytes = usedPages * pageSize;
+ memPercent = Math.max(0, Math.min(100, (usedBytes / totalBytes) * 100));
+ usedGiB = kibToGiB(usedBytes / 1024);
+ totalGiB = kibToGiB(totalBytes / 1024);
+ }
+ } catch {
+ memPercent = null;
+ usedGiB = null;
+ totalGiB = null;
+ }
+
+ return {
+ percent: toFixedNum(memPercent, 0),
+ usedGiB: usedGiB ? toFixedNum(usedGiB, 2) : null,
+ totalGiB: totalGiB ? toFixedNum(totalGiB, 2) : null,
+ };
+}
+
+// Win32_OperatingSystem reports TotalVisibleMemorySize/FreePhysicalMemory in KB.
+async function collectWindowsMemoryMetrics(client: Client): Promise<{
+ percent: number | null;
+ usedGiB: number | null;
+ totalGiB: number | null;
+}> {
+ let memPercent: number | null = null;
+ let usedGiB: number | null = null;
+ let totalGiB: number | null = null;
+
+ try {
+ const { stdout } = await execPowerShell(
+ client,
+ "$os=Get-CimInstance Win32_OperatingSystem; [PSCustomObject]@{total=$os.TotalVisibleMemorySize; free=$os.FreePhysicalMemory} | ConvertTo-Json -Compress",
+ );
+ const parsed = JSON.parse(stdout.trim());
+ const totalKb = Number(parsed?.total);
+ const freeKb = Number(parsed?.free);
+ if (Number.isFinite(totalKb) && Number.isFinite(freeKb) && totalKb > 0) {
+ const usedKb = totalKb - freeKb;
+ memPercent = Math.max(0, Math.min(100, (usedKb / totalKb) * 100));
+ usedGiB = kibToGiB(usedKb);
+ totalGiB = kibToGiB(totalKb);
+ }
+ } catch {
+ memPercent = null;
+ usedGiB = null;
+ totalGiB = null;
+ }
+
+ return {
+ percent: toFixedNum(memPercent, 0),
+ usedGiB: usedGiB ? toFixedNum(usedGiB, 2) : null,
+ totalGiB: totalGiB ? toFixedNum(totalGiB, 2) : null,
+ };
+}
+
+export async function collectMemoryMetrics(
+ client: Client,
+ platform?: HostPlatform,
+): Promise<{
+ percent: number | null;
+ usedGiB: number | null;
+ totalGiB: number | null;
+}> {
+ if (platform === "darwin") {
+ return collectDarwinMemoryMetrics(client);
+ }
+ if (platform === "windows") {
+ return collectWindowsMemoryMetrics(client);
+ }
+
+ let memPercent: number | null = null;
+ let usedGiB: number | null = null;
+ let totalGiB: number | null = null;
+
try {
const memInfo = await execCommand(client, "cat /proc/meminfo");
const lines = memInfo.stdout.split("\n");
diff --git a/src/backend/hosts/metrics/widgets/network-collector.ts b/src/backend/hosts/metrics/widgets/network-collector.ts
index f9e43c262..d2b4a425c 100644
--- a/src/backend/hosts/metrics/widgets/network-collector.ts
+++ b/src/backend/hosts/metrics/widgets/network-collector.ts
@@ -1,5 +1,9 @@
import type { Client } from "ssh2";
-import { execCommand } from "./common-utils.js";
+import {
+ execCommand,
+ execPowerShell,
+ type HostPlatform,
+} from "./common-utils.js";
export interface NetworkCounters {
rx: string;
@@ -40,7 +44,48 @@ export function counterRate(
return Math.round((second - first) / elapsedSeconds);
}
-export async function collectNetworkMetrics(client: Client): Promise<{
+export function parseDarwinIfconfig(
+ output: string,
+): Map {
+ const map = new Map |