mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: convert file manager into a plugin
This commit is contained in:
1 parent
b76da9ab52
commit
c85c1fdb86
259 files changed
+54155
-16791
No files matched your search
@@ -0,0 +1,49 @@
|
||||
-- file-manager 0001: adopt_file_manager_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `file_manager_recent` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`host_id` int NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`path` text NOT NULL,
|
||||
`last_opened` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `file_manager_recent` TO `p_file_manager_recent`;
|
||||
CREATE TABLE IF NOT EXISTS `file_manager_pinned` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`host_id` int NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`path` text NOT NULL,
|
||||
`pinned_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `file_manager_pinned` TO `p_file_manager_pinned`;
|
||||
CREATE TABLE IF NOT EXISTS `file_manager_shortcuts` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`host_id` int NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`path` text NOT NULL,
|
||||
`created_at` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `file_manager_shortcuts` TO `p_file_manager_shortcuts`;
|
||||
CREATE TABLE IF NOT EXISTS `transfer_recent` (
|
||||
`id` int AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` varchar(255) NOT NULL,
|
||||
`source_host_id` int NOT NULL,
|
||||
`dest_host_id` int NOT NULL,
|
||||
`dest_path` text NOT NULL,
|
||||
`dest_path_label` text NOT NULL,
|
||||
`last_used` text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`source_host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`dest_host_id`) REFERENCES `ssh_data` (`id`) ON DELETE CASCADE
|
||||
);
|
||||
RENAME TABLE `transfer_recent` TO `p_file_manager_transfer_recent`;
|
||||
@@ -0,0 +1,53 @@
|
||||
-- file-manager 0001: adopt_file_manager_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_recent" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"user_id" varchar(255) NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"last_opened" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_recent_user" ON "file_manager_recent" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_recent" RENAME TO "p_file_manager_recent";
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_pinned" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"user_id" varchar(255) NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"pinned_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_pinned_user" ON "file_manager_pinned" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_pinned" RENAME TO "p_file_manager_pinned";
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_shortcuts" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"user_id" varchar(255) NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_shortcuts_user" ON "file_manager_shortcuts" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_shortcuts" RENAME TO "p_file_manager_shortcuts";
|
||||
CREATE TABLE IF NOT EXISTS "transfer_recent" (
|
||||
"id" serial PRIMARY KEY,
|
||||
"user_id" varchar(255) NOT NULL,
|
||||
"source_host_id" integer NOT NULL,
|
||||
"dest_host_id" integer NOT NULL,
|
||||
"dest_path" text NOT NULL,
|
||||
"dest_path_label" text NOT NULL,
|
||||
"last_used" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("source_host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("dest_host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_transfer_recent_user" ON "transfer_recent" ("user_id");
|
||||
ALTER TABLE "transfer_recent" RENAME TO "p_file_manager_transfer_recent";
|
||||
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"version": 1,
|
||||
"tables": {
|
||||
"recent": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "refUser",
|
||||
"length": 255,
|
||||
"notNull": true
|
||||
},
|
||||
"hostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"path": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"lastOpened": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_file_manager_recent_user",
|
||||
"columns": ["userId", "hostId"]
|
||||
}
|
||||
],
|
||||
"adopts": "file_manager_recent"
|
||||
},
|
||||
"pinned": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "refUser",
|
||||
"length": 255,
|
||||
"notNull": true
|
||||
},
|
||||
"hostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"path": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"pinnedAt": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_file_manager_pinned_user",
|
||||
"columns": ["userId", "hostId"]
|
||||
}
|
||||
],
|
||||
"adopts": "file_manager_pinned"
|
||||
},
|
||||
"shortcuts": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "refUser",
|
||||
"length": 255,
|
||||
"notNull": true
|
||||
},
|
||||
"hostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"path": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_file_manager_shortcuts_user",
|
||||
"columns": ["userId", "hostId"]
|
||||
}
|
||||
],
|
||||
"adopts": "file_manager_shortcuts"
|
||||
},
|
||||
"transfer_recent": {
|
||||
"columns": {
|
||||
"id": {
|
||||
"type": "id",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"type": "refUser",
|
||||
"length": 255,
|
||||
"notNull": true
|
||||
},
|
||||
"sourceHostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"destHostId": {
|
||||
"type": "refHost",
|
||||
"notNull": true
|
||||
},
|
||||
"destPath": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"destPathLabel": {
|
||||
"type": "text",
|
||||
"notNull": true
|
||||
},
|
||||
"lastUsed": {
|
||||
"type": "timestamp",
|
||||
"notNull": true,
|
||||
"defaultNow": true
|
||||
}
|
||||
},
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_transfer_recent_user",
|
||||
"columns": ["userId"]
|
||||
}
|
||||
],
|
||||
"adopts": "transfer_recent"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
-- file-manager 0001: adopt_file_manager_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_recent" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" text NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"last_opened" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_recent_user" ON "file_manager_recent" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_recent" RENAME TO "p_file_manager_recent";
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_pinned" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" text NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"pinned_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_pinned_user" ON "file_manager_pinned" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_pinned" RENAME TO "p_file_manager_pinned";
|
||||
CREATE TABLE IF NOT EXISTS "file_manager_shortcuts" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" text NOT NULL,
|
||||
"host_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"path" text NOT NULL,
|
||||
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_file_manager_shortcuts_user" ON "file_manager_shortcuts" ("user_id", "host_id");
|
||||
ALTER TABLE "file_manager_shortcuts" RENAME TO "p_file_manager_shortcuts";
|
||||
CREATE TABLE IF NOT EXISTS "transfer_recent" (
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" text NOT NULL,
|
||||
"source_host_id" integer NOT NULL,
|
||||
"dest_host_id" integer NOT NULL,
|
||||
"dest_path" text NOT NULL,
|
||||
"dest_path_label" text NOT NULL,
|
||||
"last_used" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("source_host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE,
|
||||
FOREIGN KEY ("dest_host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "idx_transfer_recent_user" ON "transfer_recent" ("user_id");
|
||||
ALTER TABLE "transfer_recent" RENAME TO "p_file_manager_transfer_recent";
|
||||
Reference in new issue
Block a user