2023-07-25 01:03:41 +00:00
|
|
|
const config = require('config');
|
|
|
|
|
|
|
|
exports.up = async (knex) => {
|
|
|
|
await knex.schema.createTable('releases_caps', (table) => {
|
|
|
|
table.integer('release_id')
|
|
|
|
.notNullable()
|
|
|
|
.references('id')
|
2023-08-03 21:24:23 +00:00
|
|
|
.inTable('releases')
|
|
|
|
.onDelete('cascade');
|
2023-07-25 01:03:41 +00:00
|
|
|
|
|
|
|
table.text('media_id')
|
|
|
|
.notNullable()
|
|
|
|
.references('id')
|
|
|
|
.inTable('media');
|
|
|
|
});
|
|
|
|
|
|
|
|
await knex.raw('GRANT ALL ON releases_caps TO :visitor;', {
|
|
|
|
visitor: knex.raw(config.database.query.user),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.down = async (knex) => {
|
|
|
|
await knex.schema.dropTable('releases_caps');
|
|
|
|
};
|