From b2cf2dc3ebfae2a6ce7af0403d67b788f4592fe3 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 15 May 2021 03:50:27 -0400 Subject: [PATCH] model asset tables --- migrations/.gitkeep | 0 migrations/2021-05-14-221408_initial/down.sql | 1 - migrations/2021-05-14-221408_initial/up.sql | 19 ----- migrations/2021-05-15-071601_assets/down.sql | 3 + migrations/2021-05-15-071601_assets/up.sql | 71 +++++++++++++++---- 5 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 migrations/.gitkeep delete mode 100644 migrations/2021-05-14-221408_initial/down.sql delete mode 100644 migrations/2021-05-14-221408_initial/up.sql diff --git a/migrations/.gitkeep b/migrations/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/migrations/2021-05-14-221408_initial/down.sql b/migrations/2021-05-14-221408_initial/down.sql deleted file mode 100644 index 291a97c5ce..0000000000 --- a/migrations/2021-05-14-221408_initial/down.sql +++ /dev/null @@ -1 +0,0 @@ --- This file should undo anything in `up.sql` \ No newline at end of file diff --git a/migrations/2021-05-14-221408_initial/up.sql b/migrations/2021-05-14-221408_initial/up.sql deleted file mode 100644 index a26758e3f7..0000000000 --- a/migrations/2021-05-14-221408_initial/up.sql +++ /dev/null @@ -1,19 +0,0 @@ --- noinspection SqlNoDataSourceInspectionForFile - --- ============================== USERS ============================== -- - - - --- ============================== UPLOADS ============================== -- - --- ============================== MODELS ============================== -- - --- ============================== INFERENCE ============================== -- - --- ============================== WAV2LIP TEMPLATES ============================== -- - - --- ============================== RENDERED SENTENCES ============================== -- - --- ============================== LOYALTY ============================== -- - diff --git a/migrations/2021-05-15-071601_assets/down.sql b/migrations/2021-05-15-071601_assets/down.sql index 290e861cb1..8a9a8d2f98 100644 --- a/migrations/2021-05-15-071601_assets/down.sql +++ b/migrations/2021-05-15-071601_assets/down.sql @@ -1,2 +1,5 @@ # noinspection SqlNoDataSourceInspectionForFile # noinspection SqlResolveForFile + +drop table tts_models; +drop table w2l_templates; diff --git a/migrations/2021-05-15-071601_assets/up.sql b/migrations/2021-05-15-071601_assets/up.sql index d93259f562..31fee16e9c 100644 --- a/migrations/2021-05-15-071601_assets/up.sql +++ b/migrations/2021-05-15-071601_assets/up.sql @@ -1,24 +1,28 @@ # noinspection SqlNoDataSourceInspectionForFile # noinspection SqlResolveForFile -CREATE TABLE w2l_templates ( +CREATE TABLE tts_models ( -- Not used for anything except replication. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Effective "primary key" (PUBLIC) token CHAR(16) NOT NULL UNIQUE, - template_type ENUM( - 'image', - 'video' - ) NOT NULL, + -- NB: DO NOT SORT! + -- THIS MUST MATCH THE RESPECTIVE JOBS TABLE. + tts_model_type ENUM( + 'not-set', + 'tacotron2', + 'glowtts', + 'glowtts-vocodes' + ) NOT NULL DEFAULT 'not-set', -- The title of the template. title CHAR(255) NOT NULL UNIQUE, -- Users can upload their own private templates. -- They can choose to make them public later. - is_private BOOLEAN NOT NULL DEFAULT FALSE, + is_private_for_creator BOOLEAN NOT NULL DEFAULT FALSE, -- The description of the template. description CHAR(512) NOT NULL UNIQUE, @@ -41,14 +45,53 @@ CREATE TABLE w2l_templates ( -- For the thumbnail we show. public_bucket_hash CHAR(32) NOT NULL UNIQUE, - -- NB: DO NOT SORT! - -- THIS MUST MATCH THE RESPECTIVE JOBS TABLE. - tts_model_type ENUM( - 'not-set', - 'tacotron2', - 'glowtts', - 'glowtts-vocodes' - ) NOT NULL DEFAULT 'not-set', + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + + -- If this is removed. + deleted_at TIMESTAMP DEFAULT NULL + +) ENGINE=INNODB; + +CREATE TABLE w2l_templates ( + -- Not used for anything except replication. + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + + -- Effective "primary key" (PUBLIC) + token CHAR(16) NOT NULL UNIQUE, + + template_type ENUM( + 'image', + 'video' + ) NOT NULL, + + -- The title of the template. + title CHAR(255) NOT NULL UNIQUE, + + -- Users can upload their own private templates. + -- They can choose to make them public later. + is_private_for_creator BOOLEAN NOT NULL DEFAULT FALSE, + + -- The description of the template. + description CHAR(512) NOT NULL UNIQUE, + + -- The person that created the template. + creator_user_token CHAR(16) NOT NULL, + + -- For abuse tracking. + creator_ip_address CHAR(16) NOT NULL, + + -- The filename that was used at upload time. + original_filename CHAR(255) NOT NULL UNIQUE, + + -- The original source image/video + private_bucket_hash_original CHAR(32) NOT NULL UNIQUE, + + -- The "precomputed" faces. + private_bucket_hash_precomputed CHAR(32) NOT NULL UNIQUE, + + -- For the thumbnail we show. + public_bucket_hash CHAR(32) NOT NULL UNIQUE, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,