mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add support for integrated database schema migrations
added the "initprovider" command to initialize the database structure. If we change the database schema the required changes will be checked at startup and automatically applyed.
This commit is contained in:
10
sql/mysql/20200208.sql
Normal file
10
sql/mysql/20200208.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
BEGIN;
|
||||
--
|
||||
-- Create model SchemaVersion
|
||||
--
|
||||
CREATE TABLE `schema_version` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `version` integer NOT NULL);
|
||||
---
|
||||
--- Add initial version
|
||||
---
|
||||
INSERT INTO schema_version (version) VALUES (1);
|
||||
COMMIT;
|
||||
10
sql/pgsql/20200208.sql
Normal file
10
sql/pgsql/20200208.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
BEGIN;
|
||||
--
|
||||
-- Create model SchemaVersion
|
||||
--
|
||||
CREATE TABLE "schema_version" ("id" serial NOT NULL PRIMARY KEY, "version" integer NOT NULL);
|
||||
---
|
||||
--- Add initial version
|
||||
---
|
||||
INSERT INTO schema_version (version) VALUES (1);
|
||||
COMMIT;
|
||||
10
sql/sqlite/20200208.sql
Normal file
10
sql/sqlite/20200208.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
BEGIN;
|
||||
--
|
||||
-- Create model SchemaVersion
|
||||
--
|
||||
CREATE TABLE "schema_version" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "version" integer NOT NULL);
|
||||
---
|
||||
--- Add initial version
|
||||
---
|
||||
INSERT INTO schema_version (version) VALUES (1);
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user