21 lines
586 B
JavaScript
21 lines
586 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,
|
|
createdAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
|
updatedAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (collection_id) REFERENCES collection(id),
|
|
FOREIGN KEY (location_id) REFERENCES location(id)
|
|
);
|
|
`)
|
|
}
|
|
|
|
export const down = (pgm) => {
|
|
pgm.sql(`
|
|
DROP TABLE set;
|
|
`)
|
|
}
|