working on first setup of pg migrations
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export default {
|
||||
name: 'create_collection_table',
|
||||
up: async () => {
|
||||
const sql = `
|
||||
CREATE TABLE collection (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT
|
||||
);
|
||||
`
|
||||
await migrate.run([sql], pool)
|
||||
console.log('Collection table created successfully!')
|
||||
},
|
||||
down: async () => {
|
||||
const sql = `
|
||||
DROP TABLE collection;
|
||||
`
|
||||
await migrate.run([sql], pool)
|
||||
console.log('Collection table dropped successfully.')
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user