From ea81d0493737c5273758ed26e58322f501be069b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 17 Nov 2020 19:44:13 +0100 Subject: [PATCH] Adding migration files for users tables --- .../postgres_files/000003_users_table.down.sql | 1 + .../postgres_files/000003_users_table.up.sql | 14 ++++++++++++++ .../sqlite_files/000003_users_table.down.sql | 1 + .../sqlite_files/000003_users_table.up.sql | 14 ++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 server/services/store/sqlstore/migrations/postgres_files/000003_users_table.down.sql create mode 100644 server/services/store/sqlstore/migrations/postgres_files/000003_users_table.up.sql create mode 100644 server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.down.sql create mode 100644 server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.up.sql diff --git a/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.down.sql b/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.down.sql new file mode 100644 index 000000000..cc1f647d2 --- /dev/null +++ b/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.down.sql @@ -0,0 +1 @@ +DROP TABLE users; diff --git a/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.up.sql b/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.up.sql new file mode 100644 index 000000000..68f6cde60 --- /dev/null +++ b/server/services/store/sqlstore/migrations/postgres_files/000003_users_table.up.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS users ( + id VARCHAR(100), + username VARCHAR(100), + email VARCHAR(255), + password VARCHAR(100), + mfa_secret VARCHAR(100), + auth_service VARCHAR(20), + auth_data VARCHAR(255), + Props JSON, + CreateAt BIGINT, + UpdateAt BIGINT, + DeleteAt BIGINT, + PRIMARY KEY (id) +); diff --git a/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.down.sql b/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.down.sql new file mode 100644 index 000000000..cc1f647d2 --- /dev/null +++ b/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.down.sql @@ -0,0 +1 @@ +DROP TABLE users; diff --git a/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.up.sql b/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.up.sql new file mode 100644 index 000000000..1ada8c31e --- /dev/null +++ b/server/services/store/sqlstore/migrations/sqlite_files/000003_users_table.up.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS users ( + id VARCHAR(100), + username VARCHAR(100), + email VARCHAR(255), + password VARCHAR(100), + mfa_secret VARCHAR(100), + auth_service VARCHAR(20), + auth_data VARCHAR(255), + Props TEXT, + CreateAt BIGINT, + UpdateAt BIGINT, + DeleteAt BIGINT, + PRIMARY KEY (id) +);