summaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-06 17:58:35 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-06 17:58:35 +0000
commitacc32ccc1650b99e03c390a87e71b0a85b073162 (patch)
tree0de545ee0eb8eba5961c57c0a73ff7031e97613d /migrations
parente6dbcbb42e7a4a973887acde633cc3ee233aad3e (diff)
Create a 3d model object
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20220903093057_add-users-table.sql2
-rw-r--r--migrations/20220906164354_add-models-table.sql13
2 files changed, 14 insertions, 1 deletions
diff --git a/migrations/20220903093057_add-users-table.sql b/migrations/20220903093057_add-users-table.sql
index b55eae6..73c2396 100644
--- a/migrations/20220903093057_add-users-table.sql
+++ b/migrations/20220903093057_add-users-table.sql
@@ -1,5 +1,5 @@
CREATE TABLE users (
- id SERIAL UNIQUE PRIMARY KEY,
+ id SERIAL PRIMARY KEY,
email VARCHAR(100) UNIQUE NOT NULL,
username VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL,
diff --git a/migrations/20220906164354_add-models-table.sql b/migrations/20220906164354_add-models-table.sql
new file mode 100644
index 0000000..84425ba
--- /dev/null
+++ b/migrations/20220906164354_add-models-table.sql
@@ -0,0 +1,13 @@
+CREATE TABLE models (
+ id SERIAL PRIMARY KEY,
+ name VARCHAR NOT NULL,
+ description TEXT,
+ duration INTEGER NOT NULL,
+ height INTEGER NOT NULL,
+ weight INTEGER NOT NULL,
+ printer VARCHAR,
+ material VARCHAR,
+ author_id INTEGER REFERENCES users(id) NOT NULL,
+ created TIMESTAMP NOT NULL,
+ updated TIMESTAMP NOT NULL
+);