Files
tcg-collectors-server/migrations/006_create-user-table.js
T
joseph.nelson4456 569a41f053
Build and Push Image / build-and-push (push) Failing after 24s
fixed things to be more inline with how migrations work
2026-05-12 23:27:49 -07:00

21 lines
555 B
JavaScript

export const up = (pgm) => {
pgm.sql(`
CREATE TABLE user (
id UUID PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
role_id UUID,
email TEXT UNIQUE NOT NULL,
createdAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updatedAt TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (role_id) REFERENCES role(id)
);
`)
}
export const down = (pgm) => {
pgm.sql(`
DROP TABLE user;
`)
}