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,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;