updated migrations
Build and Push Image / build-and-push (push) Successful in 1m43s

This commit is contained in:
2026-05-12 22:28:51 -07:00
parent b33ae3d9a7
commit 0601c41f46
5 changed files with 68 additions and 6 deletions
+33
View File
@@ -0,0 +1,33 @@
export default {
up: async (pool) => {
try {
await pool.query(
`
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)
);
`
)
} catch (error) {
console.error('Error creating user table:', error)
throw error
}
},
down: async (pool) => {
try {
await pool.query(`
DROP TABLE user;
`)
} catch (error) {
console.error('Error dropping user table:', error)
throw error
}
},
}