fixed naming of tables to be plural and fixed order of migration execution
Build and Push Image / build-and-push (push) Successful in 1m32s

This commit is contained in:
2026-05-13 22:59:55 -07:00
parent e12bb7834d
commit 2c8baa339a
7 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE image ( CREATE TABLE images (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
file TEXT, file TEXT,
image BYTEA, image BYTEA,
@@ -12,6 +12,6 @@ export const up = (pgm) => {
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE image; DROP TABLE images;
`) `)
} }
+3 -3
View File
@@ -1,18 +1,18 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE collection ( CREATE TABLE collections (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
name TEXT, name TEXT,
image_id UUID, image_id UUID,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(),
FOREIGN KEY (image_id) REFERENCES image(id) FOREIGN KEY (image_id) REFERENCES images(id)
); );
`) `)
} }
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE collection; DROP TABLE collections;
`) `)
} }
+4 -4
View File
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE item ( CREATE TABLE items (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
collection_id UUID, collection_id UUID,
image_id UUID, image_id UUID,
@@ -12,14 +12,14 @@ export const up = (pgm) => {
extRarity TEXT, extRarity TEXT,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(),
FOREIGN KEY (collection_id) REFERENCES collection(id), FOREIGN KEY (collection_id) REFERENCES collections(id),
FOREIGN KEY (image_id) REFERENCES image(id) FOREIGN KEY (image_id) REFERENCES images(id)
); );
`) `)
} }
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE item; DROP TABLE items;
`) `)
} }
+2 -2
View File
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE location ( CREATE TABLE locations (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
name TEXT UNIQUE NOT NULL, name TEXT UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
@@ -11,6 +11,6 @@ export const up = (pgm) => {
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE location; DROP TABLE locations;
`) `)
} }
+5 -5
View File
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE set ( CREATE TABLE sets (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
collection_id UUID NOT NULL, collection_id UUID NOT NULL,
name TEXT NOT NULL, name TEXT NOT NULL,
@@ -8,15 +8,15 @@ export const up = (pgm) => {
image_id UUID, image_id UUID,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(),
FOREIGN KEY (collection_id) REFERENCES collection(id), FOREIGN KEY (collection_id) REFERENCES collections(id),
FOREIGN KEY (location_id) REFERENCES location(id), FOREIGN KEY (location_id) REFERENCES locations(id),
FOREIGN KEY (image_id) REFERENCES image(id) FOREIGN KEY (image_id) REFERENCES images(id)
); );
`) `)
} }
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE set; DROP TABLE sets;
`) `)
} }
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE role ( CREATE TABLE roles (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
name TEXT UNIQUE NOT NULL, name TEXT UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
@@ -11,6 +11,6 @@ export const up = (pgm) => {
export const down = (pmg) => { export const down = (pmg) => {
pgm.sql(` pgm.sql(`
DROP TABLE role; DROP TABLE roles;
`) `)
} }
@@ -1,6 +1,6 @@
export const up = (pgm) => { export const up = (pgm) => {
pgm.sql(` pgm.sql(`
CREATE TABLE user ( CREATE TABLE users (
id UUID PRIMARY KEY, id UUID PRIMARY KEY,
username TEXT UNIQUE NOT NULL, username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL, password TEXT NOT NULL,
@@ -8,13 +8,13 @@ export const up = (pgm) => {
email TEXT UNIQUE NOT NULL, email TEXT UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW(), created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(),
FOREIGN KEY (role_id) REFERENCES role(id) FOREIGN KEY (role_id) REFERENCES roles(id)
); );
`) `)
} }
export const down = (pgm) => { export const down = (pgm) => {
pgm.sql(` pgm.sql(`
DROP TABLE user; DROP TABLE users;
`) `)
} }