3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 06:11:49 +00:00
zeppelin/migrations/20180730230000_create_persisted_data_table.js
2018-07-30 23:35:44 +03:00

17 lines
625 B
JavaScript

exports.up = async function(knex, Promise) {
if (! await knex.schema.hasTable('persisted_data')) {
await knex.schema.createTable('persisted_data', table => {
table.string('guild_id', 20).notNullable();
table.string('user_id', 20).notNullable();
table.string('roles', 1024).nullable().defaultTo(null);
table.string('nickname', 255).nullable().defaultTo(null);
table.integer('is_voice_muted').notNullable().defaultTo(0);
table.primary(['guild_id', 'user_id']);
});
}
};
exports.down = async function(knex, Promise) {
await knex.schema.dropTableIfExists('persisted_data');
};