mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-09 03:08:57 +00:00
fix 8.0 sql (#436)
This commit is contained in:
4
scripts/upgrade/sql/8.0.0/mysql/seafevents.sql
Normal file
4
scripts/upgrade/sql/8.0.0/mysql/seafevents.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `VirusFile` ADD COLUMN IF NOT EXISTS `has_ignored` TINYINT(1) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `VirusFile` CHANGE `has_handle` `has_deleted` TINYINT(1);
|
||||
ALTER TABLE `VirusFile` ADD INDEX IF NOT EXISTS `has_deleted` (`has_deleted`);
|
||||
ALTER TABLE `VirusFile` ADD INDEX IF NOT EXISTS `has_ignored` (`has_ignored`);
|
@@ -37,8 +37,3 @@ CREATE TABLE IF NOT EXISTS `ocm_share_received` (
|
||||
KEY `ocm_share_received_repo_id_9e77a1b9` (`repo_id`),
|
||||
KEY `ocm_share_received_provider_id_60c873e0` (`provider_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `VirusFile` ADD COLUMN IF NOT EXISTS `has_ignored` TINYINT(1) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `VirusFile` CHANGE `has_handle` `has_deleted` TINYINT(1);
|
||||
ALTER TABLE `VirusFile` ADD INDEX IF NOT EXISTS `has_deleted` (`has_deleted`);
|
||||
ALTER TABLE `VirusFile` ADD INDEX IF NOT EXISTS `has_ignored` (`has_ignored`);
|
||||
|
9
scripts/upgrade/sql/8.0.0/sqlite3/seafevents.sql
Normal file
9
scripts/upgrade/sql/8.0.0/sqlite3/seafevents.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
DROP TABLE IF EXISTS "VirusFile_old";
|
||||
ALTER TABLE "VirusFile" RENAME TO "VirusFile_old";
|
||||
CREATE TABLE IF NOT EXISTS "VirusFile" ("vid" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "repo_id" varchar(36) NOT NULL, "commit_id" varchar(40) NOT NULL, "file_path" text NOT NULL, "has_deleted" tinyint(1) NOT NULL, "has_ignored" TINYINT(1) NOT NULL DEFAULT 0);
|
||||
INSERT INTO "VirusFile" ("vid", "repo_id", "commit_id", "file_path", "has_deleted") SELECT "vid", "repo_id", "commit_id", "file_path", "has_handle" FROM "VirusFile_old";
|
||||
DROP TABLE "VirusFile_old";
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_repo_id_yewnci4gd" ON "VirusFile" ("repo_id");
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_has_deleted_834ndyts" ON "VirusFile" ("has_deleted");
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_has_ignored_d84tvuwg" ON "VirusFile" ("has_ignored");
|
@@ -10,13 +10,3 @@ CREATE INDEX IF NOT EXISTS "ocm_share_received_to_user_0921d09a" ON "ocm_share_r
|
||||
CREATE INDEX IF NOT EXISTS "ocm_share_received_from_server_url_10527b80" ON "ocm_share_received" ("from_server_url");
|
||||
CREATE INDEX IF NOT EXISTS "ocm_share_received_repo_id_9e77a1b9" ON "ocm_share_received" ("repo_id");
|
||||
CREATE INDEX IF NOT EXISTS "ocm_share_received_provider_id_60c873e0" ON "ocm_share_received" ("provider_id");
|
||||
|
||||
DROP TABLE IF EXISTS "VirusFile_old";
|
||||
ALTER TABLE "VirusFile" RENAME TO "VirusFile_old";
|
||||
CREATE TABLE IF NOT EXISTS "VirusFile" ("vid" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "repo_id" varchar(36) NOT NULL, "commit_id" varchar(40) NOT NULL, "file_path" text NOT NULL, "has_deleted" tinyint(1) NOT NULL, "has_ignored" TINYINT(1) NOT NULL DEFAULT 0);
|
||||
INSERT INTO "VirusFile" ("vid", "repo_id", "commit_id", "file_path", "has_deleted") SELECT "vid", "repo_id", "commit_id", "file_path", "has_handle" FROM "VirusFile_old";
|
||||
DROP TABLE "VirusFile_old";
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_repo_id_yewnci4gd" ON "VirusFile" ("repo_id");
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_has_deleted_834ndyts" ON "VirusFile" ("has_deleted");
|
||||
CREATE INDEX IF NOT EXISTS "VirusFile_has_ignored_d84tvuwg" ON "VirusFile" ("has_ignored");
|
||||
|
Reference in New Issue
Block a user