squash database migrations

This commit is contained in:
Nicola Murino 2019-08-28 10:26:15 +02:00
parent 0e6113eef6
commit 35b0566c0e
12 changed files with 18 additions and 55 deletions

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE `users` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `username` varchar(255) NOT NULL UNIQUE, `password` varchar(255) NULL, `public_key` longtext NULL, `home_dir` varchar(255) NOT NULL, `uid` integer NOT NULL, `gid` integer NOT NULL, `max_sessions` integer NOT NULL, `quota_size` bigint NOT NULL, `quota_files` integer NOT NULL, `permissions` longtext NOT NULL, `used_quota_size` bigint NOT NULL, `used_quota_files` integer NOT NULL, `last_quota_scan` bigint NOT NULL, `upload_bandwidth` integer NOT NULL, `download_bandwidth` integer NOT NULL);
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field last_quota_scan on user to last_quota_update
--
ALTER TABLE `users` CHANGE `last_quota_scan` `last_quota_update` bigint NOT NULL;
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field public_key on user to public_keys
--
ALTER TABLE `users` CHANGE `public_key` `public_keys` longtext NULL;
COMMIT;

6
sql/mysql/20190828.sql Normal file
View file

@ -0,0 +1,6 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE `users` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `username` varchar(255) NOT NULL UNIQUE, `password` varchar(255) NULL, `public_keys` longtext NULL, `home_dir` varchar(255) NOT NULL, `uid` integer NOT NULL, `gid` integer NOT NULL, `max_sessions` integer NOT NULL, `quota_size` bigint NOT NULL, `quota_files` integer NOT NULL, `permissions` longtext NOT NULL, `used_quota_size` bigint NOT NULL, `used_quota_files` integer NOT NULL, `last_quota_update` bigint NOT NULL, `upload_bandwidth` integer NOT NULL, `download_bandwidth` integer NOT NULL);
COMMIT;

View file

@ -1,7 +0,0 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE "users" ("id" serial NOT NULL PRIMARY KEY, "username" varchar(255) NOT NULL UNIQUE, "password" varchar(255) NULL, "public_key" text NULL, "home_dir" varchar(255) NOT NULL, "uid" integer NOT NULL, "gid" integer NOT NULL, "max_sessions" integer NOT NULL, "quota_size" bigint NOT NULL, "quota_files" integer NOT NULL, "permissions" text NOT NULL, "used_quota_size" bigint NOT NULL, "used_quota_files" integer NOT NULL, "last_quota_scan" bigint NOT NULL, "upload_bandwidth" integer NOT NULL, "download_bandwidth" integer NOT NULL);
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field last_quota_scan on user to last_quota_update
--
ALTER TABLE "users" RENAME COLUMN "last_quota_scan" TO "last_quota_update";
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field public_key on user to public_keys
--
ALTER TABLE "users" RENAME COLUMN "public_key" TO "public_keys";
COMMIT;

6
sql/pgsql/20190828.sql Normal file
View file

@ -0,0 +1,6 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE "users" ("id" serial NOT NULL PRIMARY KEY, "username" varchar(255) NOT NULL UNIQUE, "password" varchar(255) NULL, "public_keys" text NULL, "home_dir" varchar(255) NOT NULL, "uid" integer NOT NULL, "gid" integer NOT NULL, "max_sessions" integer NOT NULL, "quota_size" bigint NOT NULL, "quota_files" integer NOT NULL, "permissions" text NOT NULL, "used_quota_size" bigint NOT NULL, "used_quota_files" integer NOT NULL, "last_quota_update" bigint NOT NULL, "upload_bandwidth" integer NOT NULL, "download_bandwidth" integer NOT NULL);
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE "users" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL UNIQUE, "password" varchar(255) NULL, "public_key" text NULL, "home_dir" varchar(255) NOT NULL, "uid" integer NOT NULL, "gid" integer NOT NULL, "max_sessions" integer NOT NULL, "quota_size" bigint NOT NULL, "quota_files" integer NOT NULL, "permissions" text NOT NULL, "used_quota_size" bigint NOT NULL, "used_quota_files" integer NOT NULL, "last_quota_scan" bigint NOT NULL, "upload_bandwidth" integer NOT NULL, "download_bandwidth" integer NOT NULL);
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field last_quota_scan on user to last_quota_update
--
ALTER TABLE "users" RENAME COLUMN "last_quota_scan" TO "last_quota_update";
COMMIT;

View file

@ -1,6 +0,0 @@
BEGIN;
--
-- Rename field public_key on user to public_keys
--
ALTER TABLE "users" RENAME COLUMN "public_key" TO "public_keys";
COMMIT;

6
sql/sqlite/20190828.sql Normal file
View file

@ -0,0 +1,6 @@
BEGIN;
--
-- Create model User
--
CREATE TABLE "users" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "username" varchar(255) NOT NULL UNIQUE, "password" varchar(255) NULL, "public_keys" text NULL, "home_dir" varchar(255) NOT NULL, "uid" integer NOT NULL, "gid" integer NOT NULL, "max_sessions" integer NOT NULL, "quota_size" bigint NOT NULL, "quota_files" integer NOT NULL, "permissions" text NOT NULL, "used_quota_size" bigint NOT NULL, "used_quota_files" integer NOT NULL, "last_quota_update" bigint NOT NULL, "upload_bandwidth" integer NOT NULL, "download_bandwidth" integer NOT NULL);
COMMIT;