From e86bb8427e79b4f86c9ca8fc2ec8d539fad71731 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Thu, 7 Jul 2022 12:56:56 -0400 Subject: [PATCH] Add database creation scripts for sqlite old HPR schema --- _sql/sqlite/Create_Database_Empty.sql | 4 ++++ _sql/sqlite/Create_Table_eps.sql | 16 ++++++++++++++++ _sql/sqlite/Create_Table_hosts.sql | 12 ++++++++++++ _sql/sqlite/Create_Table_licenses.sql | 8 ++++++++ _sql/sqlite/Create_Table_miniseries.sql | 10 ++++++++++ 5 files changed, 50 insertions(+) create mode 100644 _sql/sqlite/Create_Database_Empty.sql create mode 100644 _sql/sqlite/Create_Table_eps.sql create mode 100644 _sql/sqlite/Create_Table_hosts.sql create mode 100644 _sql/sqlite/Create_Table_licenses.sql create mode 100644 _sql/sqlite/Create_Table_miniseries.sql diff --git a/_sql/sqlite/Create_Database_Empty.sql b/_sql/sqlite/Create_Database_Empty.sql new file mode 100644 index 0000000..c7952b0 --- /dev/null +++ b/_sql/sqlite/Create_Database_Empty.sql @@ -0,0 +1,4 @@ +.read Create_Table_miniseries.sql +.read Create_Table_licenses.sql +.read Create_Table_hosts.sql +.read Create_Table_eps.sql diff --git a/_sql/sqlite/Create_Table_eps.sql b/_sql/sqlite/Create_Table_eps.sql new file mode 100644 index 0000000..e78d40e --- /dev/null +++ b/_sql/sqlite/Create_Table_eps.sql @@ -0,0 +1,16 @@ +CREATE TABLE eps ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + date DATE NOT NULL, + title VARCHAR(100) NOT NULL, + duration INTEGER NOT NULL, + summary VARCHAR(100) NOT NULL, + notes TEXT NOT NULL, + hostid INTEGER NOT NULL, + series INTEGER NOT NULL, + explicit INTEGER DEFAULT 1 NOT NULL, + license VARCHAR(11) DEFAULT 'CC-BY-SA' NOT NULL, + tags VARCHAR(200) NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + downloads INTEGER NOT NULL, + valid INTEGER NOT NULL +); diff --git a/_sql/sqlite/Create_Table_hosts.sql b/_sql/sqlite/Create_Table_hosts.sql new file mode 100644 index 0000000..ad71fe6 --- /dev/null +++ b/_sql/sqlite/Create_Table_hosts.sql @@ -0,0 +1,12 @@ +-- hosts definition + +CREATE TABLE hosts ( + hostid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + host TEXT NOT NULL, + email TEXT NOT NULL, + profile TEXT NOT NULL, + license VARCHAR(11) DEFAULT 'CC-BY-SA', + local_image INTEGER DEFAULT 0 NOT NULL, + gpg TEXT NOT NULL, + espeak_name TEXT +); diff --git a/_sql/sqlite/Create_Table_licenses.sql b/_sql/sqlite/Create_Table_licenses.sql new file mode 100644 index 0000000..f6f2f4d --- /dev/null +++ b/_sql/sqlite/Create_Table_licenses.sql @@ -0,0 +1,8 @@ +-- licenses definition + +CREATE TABLE licenses ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + short_name VARCHAR(11) NOT NULL, + long_name VARCHAR(40) NOT NULL, + url VARCHAR(80) NOT NULL +); diff --git a/_sql/sqlite/Create_Table_miniseries.sql b/_sql/sqlite/Create_Table_miniseries.sql new file mode 100644 index 0000000..1fe8e63 --- /dev/null +++ b/_sql/sqlite/Create_Table_miniseries.sql @@ -0,0 +1,10 @@ +-- miniseries definition + +CREATE TABLE miniseries ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + name VARCHAR(100) NOT NULL, + description TEXT NOT NULL, + private INTEGER NOT NULL, + image TEXT NOT NULL, + valid INTEGER DEFAULT 1 NOT NULL +);