open-music-api-node
Version:
49 lines (45 loc) • 776 B
JavaScript
/* eslint-disable camelcase */
exports.shorthands = undefined;
exports.up = (pgm) => {
pgm.createTable('songs', {
id: {
type: 'VARCHAR(50)',
primaryKey: true,
},
title: {
type: 'TEXT',
notNull: true,
},
year: {
type: 'INTEGER',
notNull: true,
},
genre: {
type: 'TEXT',
notNull: true,
},
performer: {
type: 'TEXT',
notNull: true,
},
duration: {
type: 'INTEGER',
notNull: false,
},
album_id: {
type: 'TEXT',
notNull: false,
},
created_at: {
type: 'TIMESTAMP',
notNull: true,
},
updated_at: {
type: 'TIMESTAMP',
notNull: true,
},
});
};
exports.down = (pgm) => {
pgm.dropTable('songs');
};