working on first setup of pg migrations

This commit is contained in:
2026-05-10 19:51:13 -07:00
parent 3cdec698ef
commit 5318a1eb4a
5 changed files with 121 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
export default {
name: 'create_image_table',
up: async () => {
const sql = `
CREATE TABLE image (
id UUID PRIMARY KEY,
file TEXT,
image BYTEA
);
`
await migrate.run([sql], pool)
console.log('Image table created successfully!')
},
down: async () => {
const sql = `
DROP TABLE image;
`
await migrate.run([sql], pool)
console.log('Image table dropped successfully.')
},
}