Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(backend:migrations): squash all previous SQL migrations into a single baseline

johaven7b3ad6994a30
diff --git a/backend/migrations/0003_fancy_gauntlet.sql b/backend/migrations/0003_fancy_gauntlet.sql
deleted file mode 100644
index fa76da7b..00000000
--- a/backend/migrations/0003_fancy_gauntlet.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `users` ADD `storageIndexing` boolean DEFAULT true NOT NULL;--> statement-breakpoint
-ALTER TABLE `spaces` ADD `storageIndexing` boolean DEFAULT true NOT NULL;
\ No newline at end of file
diff --git a/backend/migrations/0003_giant_luckman.sql b/backend/migrations/0003_giant_luckman.sql
new file mode 100644
index 00000000..dc93ae80
--- /dev/null
+++ b/backend/migrations/0003_giant_luckman.sql
@@ -0,0 +1,6 @@
+ALTER TABLE `users` MODIFY COLUMN `language` varchar(10);--> statement-breakpoint
+ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `storageIndexing` boolean DEFAULT true NOT NULL;--> statement-breakpoint
+ALTER TABLE `spaces` ADD COLUMN IF NOT EXISTS `storageIndexing` boolean DEFAULT true NOT NULL;--> statement-breakpoint
+ALTER TABLE `shares` ADD COLUMN IF NOT EXISTS `storageUsage` bigint unsigned DEFAULT 0 NOT NULL;--> statement-breakpoint
+ALTER TABLE `shares` ADD COLUMN IF NOT EXISTS `storageQuota` bigint unsigned;--> statement-breakpoint
+ALTER TABLE `shares` ADD COLUMN IF NOT EXISTS `storageIndexing` boolean DEFAULT true NOT NULL;
\ No newline at end of file
diff --git a/backend/migrations/0004_soft_sphinx.sql b/backend/migrations/0004_soft_sphinx.sql
deleted file mode 100644
index 15952428..00000000
--- a/backend/migrations/0004_soft_sphinx.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE `shares` ADD `storageUsage` bigint unsigned DEFAULT 0 NOT NULL;--> statement-breakpoint
-ALTER TABLE `shares` ADD `storageQuota` bigint unsigned;--> statement-breakpoint
-ALTER TABLE `shares` ADD `storageIndexing` boolean DEFAULT true NOT NULL;
\ No newline at end of file
diff --git a/backend/migrations/meta/0003_snapshot.json b/backend/migrations/meta/0003_snapshot.json
index 0b18ae64..875557f6 100644
--- a/backend/migrations/meta/0003_snapshot.json
+++ b/backend/migrations/meta/0003_snapshot.json
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "mysql",
- "id": "ffa22779-d12a-4b0e-9aed-657e020cc05d",
+ "id": "da1a6d68-b222-46e6-bda9-2a917b447be2",
"prevId": "076fc362-3587-4607-8075-e08cb473342e",
"tables": {
"cache": {
@@ -129,7 +129,7 @@
},
"language": {
"name": "language",
- "type": "char(2)",
+ "type": "varchar(10)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
@@ -1089,6 +1089,29 @@
"notNull": false,
"autoincrement": false
},
+ "storageUsage": {
+ "name": "storageUsage",
+ "type": "bigint unsigned",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "storageQuota": {
+ "name": "storageQuota",
+ "type": "bigint unsigned",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "storageIndexing": {
+ "name": "storageIndexing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
"createdAt": {
"name": "createdAt",
"type": "datetime",
diff --git a/backend/migrations/meta/0004_snapshot.json b/backend/migrations/meta/0004_snapshot.json
deleted file mode 100644
index 458d6a47..00000000
--- a/backend/migrations/meta/0004_snapshot.json
+++ /dev/null
@@ -1,2463 +0,0 @@
-{
- "version": "5",
- "dialect": "mysql",
- "id": "96aa812c-d329-429d-9d0e-e54bc26ae093",
- "prevId": "ffa22779-d12a-4b0e-9aed-657e020cc05d",
- "tables": {
- "cache": {
- "name": "cache",
- "columns": {
- "key": {
- "name": "key",
- "type": "varchar(768)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "json",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expiration": {
- "name": "expiration",
- "type": "int",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": -1
- }
- },
- "indexes": {
- "expiration_idx": {
- "name": "expiration_idx",
- "columns": [
- "expiration"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {
- "cache_key": {
- "name": "cache_key",
- "columns": [
- "key"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "email": {
- "name": "email",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "login": {
- "name": "login",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "firstName": {
- "name": "firstName",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "lastName": {
- "name": "lastName",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "passwordAttempts": {
- "name": "passwordAttempts",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "role": {
- "name": "role",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 1
- },
- "isActive": {
- "name": "isActive",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "secrets": {
- "name": "secrets",
- "type": "json",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "language": {
- "name": "language",
- "type": "char(2)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "storageUsage": {
- "name": "storageUsage",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": 0
- },
- "storageQuota": {
- "name": "storageQuota",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "storageIndexing": {
- "name": "storageIndexing",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "notification": {
- "name": "notification",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 1
- },
- "onlineStatus": {
- "name": "onlineStatus",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "currentIp": {
- "name": "currentIp",
- "type": "varchar(45)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "lastIp": {
- "name": "lastIp",
- "type": "varchar(45)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "currentAccess": {
- "name": "currentAccess",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "lastAccess": {
- "name": "lastAccess",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "email_idx": {
- "name": "email_idx",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "login_idx": {
- "name": "login_idx",
- "columns": [
- "login"
- ],
- "isUnique": true
- },
- "role_idx": {
- "name": "role_idx",
- "columns": [
- "role"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {
- "users_id": {
- "name": "users_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "groups": {
- "name": "groups",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "type": {
- "name": "type",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "visibility": {
- "name": "visibility",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "parentId": {
- "name": "parentId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "name_idx": {
- "name": "name_idx",
- "columns": [
- "name"
- ],
- "isUnique": true
- },
- "parent_idx": {
- "name": "parent_idx",
- "columns": [
- "parentId"
- ],
- "isUnique": false
- },
- "type_idx": {
- "name": "type_idx",
- "columns": [
- "type"
- ],
- "isUnique": false
- },
- "visibility_idx": {
- "name": "visibility_idx",
- "columns": [
- "visibility"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "groups_parentId_groups_id_fk": {
- "name": "groups_parentId_groups_id_fk",
- "tableFrom": "groups",
- "tableTo": "groups",
- "columnsFrom": [
- "parentId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "groups_id": {
- "name": "groups_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "users_groups": {
- "name": "users_groups",
- "columns": {
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "groupId": {
- "name": "groupId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "group_idx": {
- "name": "group_idx",
- "columns": [
- "groupId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "users_groups_userId_users_id_fk": {
- "name": "users_groups_userId_users_id_fk",
- "tableFrom": "users_groups",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "users_groups_groupId_groups_id_fk": {
- "name": "users_groups_groupId_groups_id_fk",
- "tableFrom": "users_groups",
- "tableTo": "groups",
- "columnsFrom": [
- "groupId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "users_groups_userId_groupId_pk": {
- "name": "users_groups_userId_groupId_pk",
- "columns": [
- "userId",
- "groupId"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "users_guests": {
- "name": "users_guests",
- "columns": {
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "guestId": {
- "name": "guestId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "guest_id": {
- "name": "guest_id",
- "columns": [
- "guestId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "users_guests_userId_users_id_fk": {
- "name": "users_guests_userId_users_id_fk",
- "tableFrom": "users_guests",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "users_guests_guestId_users_id_fk": {
- "name": "users_guests_guestId_users_id_fk",
- "tableFrom": "users_guests",
- "tableTo": "users",
- "columnsFrom": [
- "guestId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "users_guests_userId_guestId_pk": {
- "name": "users_guests_userId_guestId_pk",
- "columns": [
- "userId",
- "guestId"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {
- "user_guest_check": {
- "name": "user_guest_check",
- "value": "`users_guests`.`userId` <> `users_guests`.`guestId`"
- }
- }
- },
- "spaces": {
- "name": "spaces",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "alias": {
- "name": "alias",
- "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": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "storageUsage": {
- "name": "storageUsage",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "storageQuota": {
- "name": "storageQuota",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "storageIndexing": {
- "name": "storageIndexing",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- },
- "disabledAt": {
- "name": "disabledAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "alias_idx": {
- "name": "alias_idx",
- "columns": [
- "alias"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {
- "spaces_id": {
- "name": "spaces_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "spaces_members": {
- "name": "spaces_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "groupId": {
- "name": "groupId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "linkId": {
- "name": "linkId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "permissions": {
- "name": "permissions",
- "type": "varchar(32)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "''"
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "group_idx": {
- "name": "group_idx",
- "columns": [
- "groupId"
- ],
- "isUnique": false
- },
- "link_idx": {
- "name": "link_idx",
- "columns": [
- "linkId"
- ],
- "isUnique": false
- },
- "role_idx": {
- "name": "role_idx",
- "columns": [
- "role"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "spaces_members_spaceId_spaces_id_fk": {
- "name": "spaces_members_spaceId_spaces_id_fk",
- "tableFrom": "spaces_members",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "spaces_members_userId_users_id_fk": {
- "name": "spaces_members_userId_users_id_fk",
- "tableFrom": "spaces_members",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "spaces_members_groupId_groups_id_fk": {
- "name": "spaces_members_groupId_groups_id_fk",
- "tableFrom": "spaces_members",
- "tableTo": "groups",
- "columnsFrom": [
- "groupId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "spaces_members_linkId_links_id_fk": {
- "name": "spaces_members_linkId_links_id_fk",
- "tableFrom": "spaces_members",
- "tableTo": "links",
- "columnsFrom": [
- "linkId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "spaces_members_id": {
- "name": "spaces_members_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {
- "space_user_uniq": {
- "name": "space_user_uniq",
- "columns": [
- "spaceId",
- "userId"
- ]
- },
- "space_group_uniq": {
- "name": "space_group_uniq",
- "columns": [
- "spaceId",
- "groupId"
- ]
- },
- "space_link_uniq": {
- "name": "space_link_uniq",
- "columns": [
- "spaceId",
- "linkId"
- ]
- }
- },
- "checkConstraint": {}
- },
- "spaces_roots": {
- "name": "spaces_roots",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "fileId": {
- "name": "fileId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "alias": {
- "name": "alias",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "externalPath": {
- "name": "externalPath",
- "type": "varchar(4096)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "varchar(32)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "''"
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "alias_idx": {
- "name": "alias_idx",
- "columns": [
- "alias"
- ],
- "isUnique": false
- },
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "file_idx": {
- "name": "file_idx",
- "columns": [
- "fileId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "spaces_roots_spaceId_spaces_id_fk": {
- "name": "spaces_roots_spaceId_spaces_id_fk",
- "tableFrom": "spaces_roots",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "spaces_roots_fileId_files_id_fk": {
- "name": "spaces_roots_fileId_files_id_fk",
- "tableFrom": "spaces_roots",
- "tableTo": "files",
- "columnsFrom": [
- "fileId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "spaces_roots_id": {
- "name": "spaces_roots_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {
- "space_root_alias_uniq": {
- "name": "space_root_alias_uniq",
- "columns": [
- "id",
- "alias"
- ]
- }
- },
- "checkConstraint": {}
- },
- "shares": {
- "name": "shares",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "ownerId": {
- "name": "ownerId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "parentId": {
- "name": "parentId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceRootId": {
- "name": "spaceRootId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "fileId": {
- "name": "fileId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "externalPath": {
- "name": "externalPath",
- "type": "varchar(4096)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "type": {
- "name": "type",
- "type": "tinyint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "alias": {
- "name": "alias",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "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
- },
- "description": {
- "name": "description",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "storageUsage": {
- "name": "storageUsage",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "storageQuota": {
- "name": "storageQuota",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "storageIndexing": {
- "name": "storageIndexing",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- },
- "disabledAt": {
- "name": "disabledAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "alias_idx": {
- "name": "alias_idx",
- "columns": [
- "alias"
- ],
- "isUnique": true
- },
- "parent_idx": {
- "name": "parent_idx",
- "columns": [
- "parentId"
- ],
- "isUnique": false
- },
- "owner_idx": {
- "name": "owner_idx",
- "columns": [
- "ownerId"
- ],
- "isUnique": false
- },
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "space_root_idx": {
- "name": "space_root_idx",
- "columns": [
- "spaceRootId"
- ],
- "isUnique": false
- },
- "file_idx": {
- "name": "file_idx",
- "columns": [
- "fileId"
- ],
- "isUnique": false
- },
- "type_idx": {
- "name": "type_idx",
- "columns": [
- "type"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "shares_ownerId_users_id_fk": {
- "name": "shares_ownerId_users_id_fk",
- "tableFrom": "shares",
- "tableTo": "users",
- "columnsFrom": [
- "ownerId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_parentId_shares_id_fk": {
- "name": "shares_parentId_shares_id_fk",
- "tableFrom": "shares",
- "tableTo": "shares",
- "columnsFrom": [
- "parentId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_spaceId_spaces_id_fk": {
- "name": "shares_spaceId_spaces_id_fk",
- "tableFrom": "shares",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_spaceRootId_spaces_roots_id_fk": {
- "name": "shares_spaceRootId_spaces_roots_id_fk",
- "tableFrom": "shares",
- "tableTo": "spaces_roots",
- "columnsFrom": [
- "spaceRootId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_fileId_files_id_fk": {
- "name": "shares_fileId_files_id_fk",
- "tableFrom": "shares",
- "tableTo": "files",
- "columnsFrom": [
- "fileId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "shares_id": {
- "name": "shares_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "shares_members": {
- "name": "shares_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "shareId": {
- "name": "shareId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "groupId": {
- "name": "groupId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "linkId": {
- "name": "linkId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "varchar(32)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "''"
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "share_idx": {
- "name": "share_idx",
- "columns": [
- "shareId"
- ],
- "isUnique": false
- },
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "group_idx": {
- "name": "group_idx",
- "columns": [
- "groupId"
- ],
- "isUnique": false
- },
- "link_idx": {
- "name": "link_idx",
- "columns": [
- "linkId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "shares_members_shareId_shares_id_fk": {
- "name": "shares_members_shareId_shares_id_fk",
- "tableFrom": "shares_members",
- "tableTo": "shares",
- "columnsFrom": [
- "shareId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_members_userId_users_id_fk": {
- "name": "shares_members_userId_users_id_fk",
- "tableFrom": "shares_members",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_members_groupId_groups_id_fk": {
- "name": "shares_members_groupId_groups_id_fk",
- "tableFrom": "shares_members",
- "tableTo": "groups",
- "columnsFrom": [
- "groupId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "shares_members_linkId_links_id_fk": {
- "name": "shares_members_linkId_links_id_fk",
- "tableFrom": "shares_members",
- "tableTo": "links",
- "columnsFrom": [
- "linkId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "shares_members_id": {
- "name": "shares_members_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {
- "share_user_uniq": {
- "name": "share_user_uniq",
- "columns": [
- "shareId",
- "userId"
- ]
- },
- "share_group_uniq": {
- "name": "share_group_uniq",
- "columns": [
- "shareId",
- "groupId"
- ]
- },
- "share_link_uniq": {
- "name": "share_link_uniq",
- "columns": [
- "shareId",
- "linkId"
- ]
- }
- },
- "checkConstraint": {}
- },
- "files": {
- "name": "files",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "ownerId": {
- "name": "ownerId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceExternalRootId": {
- "name": "spaceExternalRootId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "shareExternalId": {
- "name": "shareExternalId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "path": {
- "name": "path",
- "type": "varchar(4096)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "isDir": {
- "name": "isDir",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inTrash": {
- "name": "inTrash",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "mime": {
- "name": "mime",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "size": {
- "name": "size",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": 0
- },
- "mtime": {
- "name": "mtime",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": 0
- },
- "ctime": {
- "name": "ctime",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": 0
- }
- },
- "indexes": {
- "owner_idx": {
- "name": "owner_idx",
- "columns": [
- "ownerId"
- ],
- "isUnique": false
- },
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "space_external_root_idx": {
- "name": "space_external_root_idx",
- "columns": [
- "spaceExternalRootId"
- ],
- "isUnique": false
- },
- "share_external_idx": {
- "name": "share_external_idx",
- "columns": [
- "shareExternalId"
- ],
- "isUnique": false
- },
- "name_idx": {
- "name": "name_idx",
- "columns": [
- "name"
- ],
- "isUnique": false
- },
- "path_idx": {
- "name": "path_idx",
- "columns": [
- "path"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "files_ownerId_users_id_fk": {
- "name": "files_ownerId_users_id_fk",
- "tableFrom": "files",
- "tableTo": "users",
- "columnsFrom": [
- "ownerId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "files_spaceId_spaces_id_fk": {
- "name": "files_spaceId_spaces_id_fk",
- "tableFrom": "files",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "files_spaceExternalRootId_spaces_roots_id_fk": {
- "name": "files_spaceExternalRootId_spaces_roots_id_fk",
- "tableFrom": "files",
- "tableTo": "spaces_roots",
- "columnsFrom": [
- "spaceExternalRootId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "files_shareExternalId_shares_id_fk": {
- "name": "files_shareExternalId_shares_id_fk",
- "tableFrom": "files",
- "tableTo": "shares",
- "columnsFrom": [
- "shareExternalId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "files_id": {
- "name": "files_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "files_recents": {
- "name": "files_recents",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "ownerId": {
- "name": "ownerId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "shareId": {
- "name": "shareId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "path": {
- "name": "path",
- "type": "varchar(4096)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime": {
- "name": "mime",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "mtime": {
- "name": "mtime",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "owner_idx": {
- "name": "owner_idx",
- "columns": [
- "ownerId"
- ],
- "isUnique": false
- },
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "share_idx": {
- "name": "share_idx",
- "columns": [
- "shareId"
- ],
- "isUnique": false
- },
- "mtime_idx": {
- "name": "mtime_idx",
- "columns": [
- "mtime"
- ],
- "isUnique": false
- },
- "path_idx": {
- "name": "path_idx",
- "columns": [
- "path"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "files_recents_ownerId_users_id_fk": {
- "name": "files_recents_ownerId_users_id_fk",
- "tableFrom": "files_recents",
- "tableTo": "users",
- "columnsFrom": [
- "ownerId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "files_recents_spaceId_spaces_id_fk": {
- "name": "files_recents_spaceId_spaces_id_fk",
- "tableFrom": "files_recents",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "files_recents_shareId_shares_id_fk": {
- "name": "files_recents_shareId_shares_id_fk",
- "tableFrom": "files_recents",
- "tableTo": "shares",
- "columnsFrom": [
- "shareId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "links": {
- "name": "links",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "uuid": {
- "name": "uuid",
- "type": "varchar(32)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "requireAuth": {
- "name": "requireAuth",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "nbAccess": {
- "name": "nbAccess",
- "type": "int unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "limitAccess": {
- "name": "limitAccess",
- "type": "int unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "expiresAt": {
- "name": "expiresAt",
- "type": "date",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "uuid_idx": {
- "name": "uuid_idx",
- "columns": [
- "uuid"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "links_userId_users_id_fk": {
- "name": "links_userId_users_id_fk",
- "tableFrom": "links",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "links_id": {
- "name": "links_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "comments": {
- "name": "comments",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "userId": {
- "name": "userId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "fileId": {
- "name": "fileId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "modifiedAt": {
- "name": "modifiedAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "user_idx": {
- "name": "user_idx",
- "columns": [
- "userId"
- ],
- "isUnique": false
- },
- "file_idx": {
- "name": "file_idx",
- "columns": [
- "fileId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "comments_userId_users_id_fk": {
- "name": "comments_userId_users_id_fk",
- "tableFrom": "comments",
- "tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "comments_fileId_files_id_fk": {
- "name": "comments_fileId_files_id_fk",
- "tableFrom": "comments",
- "tableTo": "files",
- "columnsFrom": [
- "fileId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "comments_id": {
- "name": "comments_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "notifications": {
- "name": "notifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "fromUserId": {
- "name": "fromUserId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "toUserId": {
- "name": "toUserId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "json",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "wasRead": {
- "name": "wasRead",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "from_user_idx": {
- "name": "from_user_idx",
- "columns": [
- "fromUserId"
- ],
- "isUnique": false
- },
- "to_user_idx": {
- "name": "to_user_idx",
- "columns": [
- "toUserId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "notifications_fromUserId_users_id_fk": {
- "name": "notifications_fromUserId_users_id_fk",
- "tableFrom": "notifications",
- "tableTo": "users",
- "columnsFrom": [
- "fromUserId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "notifications_toUserId_users_id_fk": {
- "name": "notifications_toUserId_users_id_fk",
- "tableFrom": "notifications",
- "tableTo": "users",
- "columnsFrom": [
- "toUserId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "notifications_id": {
- "name": "notifications_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "sync_clients": {
- "name": "sync_clients",
- "columns": {
- "id": {
- "name": "id",
- "type": "char(36)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ownerId": {
- "name": "ownerId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "char(36)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tokenExpiration": {
- "name": "tokenExpiration",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "info": {
- "name": "info",
- "type": "json",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "currentIp": {
- "name": "currentIp",
- "type": "varchar(45)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "lastIp": {
- "name": "lastIp",
- "type": "varchar(45)",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "currentAccess": {
- "name": "currentAccess",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "lastAccess": {
- "name": "lastAccess",
- "type": "datetime",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "owner_idx": {
- "name": "owner_idx",
- "columns": [
- "ownerId"
- ],
- "isUnique": false
- },
- "token_idx": {
- "name": "token_idx",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "sync_clients_ownerId_users_id_fk": {
- "name": "sync_clients_ownerId_users_id_fk",
- "tableFrom": "sync_clients",
- "tableTo": "users",
- "columnsFrom": [
- "ownerId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "sync_clients_id": {
- "name": "sync_clients_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- },
- "sync_paths": {
- "name": "sync_paths",
- "columns": {
- "id": {
- "name": "id",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": true
- },
- "clientId": {
- "name": "clientId",
- "type": "char(36)",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ownerId": {
- "name": "ownerId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceId": {
- "name": "spaceId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "spaceRootId": {
- "name": "spaceRootId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "shareId": {
- "name": "shareId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "fileId": {
- "name": "fileId",
- "type": "bigint unsigned",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "settings": {
- "name": "settings",
- "type": "json",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "datetime",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "CURRENT_TIMESTAMP"
- }
- },
- "indexes": {
- "client_idx": {
- "name": "client_idx",
- "columns": [
- "clientId"
- ],
- "isUnique": false
- },
- "owner_idx": {
- "name": "owner_idx",
- "columns": [
- "ownerId"
- ],
- "isUnique": false
- },
- "space_idx": {
- "name": "space_idx",
- "columns": [
- "spaceId"
- ],
- "isUnique": false
- },
- "space_root_idx": {
- "name": "space_root_idx",
- "columns": [
- "spaceRootId"
- ],
- "isUnique": false
- },
- "share_idx": {
- "name": "share_idx",
- "columns": [
- "shareId"
- ],
- "isUnique": false
- },
- "file_idx": {
- "name": "file_idx",
- "columns": [
- "fileId"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "sync_paths_clientId_sync_clients_id_fk": {
- "name": "sync_paths_clientId_sync_clients_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "sync_clients",
- "columnsFrom": [
- "clientId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "sync_paths_ownerId_users_id_fk": {
- "name": "sync_paths_ownerId_users_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "users",
- "columnsFrom": [
- "ownerId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "sync_paths_spaceId_spaces_id_fk": {
- "name": "sync_paths_spaceId_spaces_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "spaces",
- "columnsFrom": [
- "spaceId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "sync_paths_spaceRootId_spaces_roots_id_fk": {
- "name": "sync_paths_spaceRootId_spaces_roots_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "spaces_roots",
- "columnsFrom": [
- "spaceRootId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "sync_paths_shareId_shares_id_fk": {
- "name": "sync_paths_shareId_shares_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "shares",
- "columnsFrom": [
- "shareId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "sync_paths_fileId_files_id_fk": {
- "name": "sync_paths_fileId_files_id_fk",
- "tableFrom": "sync_paths",
- "tableTo": "files",
- "columnsFrom": [
- "fileId"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "sync_paths_id": {
- "name": "sync_paths_id",
- "columns": [
- "id"
- ]
- }
- },
- "uniqueConstraints": {},
- "checkConstraint": {}
- }
- },
- "views": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "tables": {},
- "indexes": {}
- }
-}
\ No newline at end of file
diff --git a/backend/migrations/meta/_journal.json b/backend/migrations/meta/_journal.json
index b733c2d6..83377f3c 100644
--- a/backend/migrations/meta/_journal.json
+++ b/backend/migrations/meta/_journal.json
@@ -26,15 +26,8 @@
{
"idx": 3,
"version": "5",
- "when": 1760089921667,
- "tag": "0003_fancy_gauntlet",
- "breakpoints": true
- },
- {
- "idx": 4,
- "version": "5",
- "when": 1760345527424,
- "tag": "0004_soft_sphinx",
+ "when": 1761385913473,
+ "tag": "0003_giant_luckman",
"breakpoints": true
}
]
diff --git a/backend/src/applications/users/schemas/users.schema.ts b/backend/src/applications/users/schemas/users.schema.ts
index dba2cb56..9f84a000 100644
--- a/backend/src/applications/users/schemas/users.schema.ts
+++ b/backend/src/applications/users/schemas/users.schema.ts
@@ -5,7 +5,7 @@
*/
import { SQL, sql } from 'drizzle-orm'
-import { bigint, boolean, char, datetime, index, mysqlTable, tinyint, uniqueIndex, varchar } from 'drizzle-orm/mysql-core'
+import { bigint, boolean, datetime, index, mysqlTable, tinyint, uniqueIndex, varchar } from 'drizzle-orm/mysql-core'
import { jsonColumn } from '../../../infrastructure/database/columns'
import { UserSecrets } from '../interfaces/user-secrets.interface'
@@ -42,7 +42,7 @@ export const users = mysqlTable(
role: tinyint('role', { unsigned: true }).default(1).notNull(),
isActive: boolean('isActive').default(true).notNull(),
secrets: jsonColumn<UserSecrets>()('secrets'),
- language: char('language', { length: 2 }),
+ language: varchar('language', { length: 10 }),
permissions: varchar('permissions', { length: 255 }).default('').notNull(),
storageUsage: bigint('storageUsage', { mode: 'number', unsigned: true }).default(0),
storageQuota: bigint('storageQuota', { mode: 'number', unsigned: true }),