This commit is contained in:
@@ -3,7 +3,9 @@ export const up = (pgm) => {
|
|||||||
CREATE TABLE image (
|
CREATE TABLE image (
|
||||||
id UUID PRIMARY KEY,
|
id UUID PRIMARY KEY,
|
||||||
file TEXT,
|
file TEXT,
|
||||||
image BYTEA
|
image BYTEA,
|
||||||
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW(),
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
+5
-1
@@ -2,7 +2,11 @@ export const up = (pgm) => {
|
|||||||
pgm.sql(`
|
pgm.sql(`
|
||||||
CREATE TABLE collection (
|
CREATE TABLE collection (
|
||||||
id UUID PRIMARY KEY,
|
id UUID PRIMARY KEY,
|
||||||
name TEXT
|
name TEXT,
|
||||||
|
image_id UUID,
|
||||||
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
FOREIGN KEY (image_id) REFERENCES image(id)
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
@@ -7,9 +7,11 @@ export const up = (pgm) => {
|
|||||||
productId TEXT,
|
productId TEXT,
|
||||||
name TEXT,
|
name TEXT,
|
||||||
cleanName TEXT,
|
cleanName TEXT,
|
||||||
extCardText TEXTAREA,
|
extCardText TEXT,
|
||||||
marketPrice TEXT,
|
marketPrice TEXT,
|
||||||
extRarity TEXT,
|
extRarity TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW(),
|
||||||
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
||||||
FOREIGN KEY (image_id) REFERENCES image(id)
|
FOREIGN KEY (image_id) REFERENCES image(id)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ export const up = (pgm) => {
|
|||||||
CREATE TABLE location (
|
CREATE TABLE location (
|
||||||
id UUID PRIMARY KEY,
|
id UUID PRIMARY KEY,
|
||||||
name TEXT UNIQUE NOT NULL
|
name TEXT UNIQUE NOT NULL
|
||||||
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW()
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ export const up = (pgm) => {
|
|||||||
collection_id UUID NOT NULL,
|
collection_id UUID NOT NULL,
|
||||||
name TEXT NOT NULL,
|
name TEXT NOT NULL,
|
||||||
location_id UUID,
|
location_id UUID,
|
||||||
createdAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
image_id UUID,
|
||||||
updatedAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW(),
|
||||||
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
||||||
FOREIGN KEY (location_id) REFERENCES location(id)
|
FOREIGN KEY (location_id) REFERENCES location(id),
|
||||||
|
FOREIGN KEY (image_id) REFERENCES image(id)
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ export const up = (pgm) => {
|
|||||||
password TEXT NOT NULL,
|
password TEXT NOT NULL,
|
||||||
role_id UUID,
|
role_id UUID,
|
||||||
email TEXT UNIQUE NOT NULL,
|
email TEXT UNIQUE NOT NULL,
|
||||||
createdAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
updatedAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
updated_at TIMESTAMP DEFAULT NOW(),
|
||||||
FOREIGN KEY (role_id) REFERENCES role(id)
|
FOREIGN KEY (role_id) REFERENCES role(id)
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ export const up = (pgm) => {
|
|||||||
pgm.sql(`
|
pgm.sql(`
|
||||||
CREATE TABLE role (
|
CREATE TABLE role (
|
||||||
id UUID PRIMARY KEY,
|
id UUID PRIMARY KEY,
|
||||||
name TEXT UNIQUE NOT NULL
|
name TEXT UNIQUE NOT NULL,
|
||||||
|
created_at TIMESTAMP DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP DEFAULT NOW()
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user