UNPKG

open-music-api-node

Version:
34 lines (30 loc) 635 B
/* eslint-disable camelcase */ exports.shorthands = undefined; exports.up = (pgm) => { pgm.createTable('playlist', { id: { type: 'VARCHAR(50)', primaryKey: true, }, name: { type: 'TEXT', notNull: true, }, owner: { type: 'TEXT', notNull: true, }, created_at: { type: 'TIMESTAMP', notNull: true, }, updated_at: { type: 'TIMESTAMP', notNull: true, }, }); pgm.addConstraint('playlist', 'fk_playlist_owner', 'FOREIGN KEY(owner) REFERENCES users(id) ON DELETE CASCADE'); }; exports.down = (pgm) => { pgm.dropTable('playlist'); };