open-music-api-node
Version:
33 lines (29 loc) • 518 B
JavaScript
/* eslint-disable camelcase */
exports.shorthands = undefined;
exports.up = (pgm) => {
pgm.createTable('albums', {
id: {
type: 'VARCHAR(50)',
primaryKey: true,
},
name: {
type: 'TEXT',
notNull: true,
},
year: {
type: 'INTEGER',
notNull: true,
},
created_at: {
type: 'TIMESTAMP',
notNull: true,
},
updated_at: {
type: 'TIMESTAMP',
notNull: true,
},
});
};
exports.down = (pgm) => {
pgm.dropTable('albums');
};