23 lines
618 B
JavaScript
23 lines
618 B
JavaScript
export const up = (pgm) => {
|
|
pgm.sql(`
|
|
CREATE TABLE set (
|
|
id UUID PRIMARY KEY,
|
|
collection_id UUID NOT NULL,
|
|
name TEXT NOT NULL,
|
|
location_id UUID,
|
|
image_id UUID,
|
|
created_at TIMESTAMP DEFAULT NOW(),
|
|
updated_at TIMESTAMP DEFAULT NOW(),
|
|
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
|
FOREIGN KEY (location_id) REFERENCES location(id),
|
|
FOREIGN KEY (image_id) REFERENCES image(id)
|
|
);
|
|
`)
|
|
}
|
|
|
|
export const down = (pgm) => {
|
|
pgm.sql(`
|
|
DROP TABLE set;
|
|
`)
|
|
}
|