3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 06:11:49 +00:00
zeppelin/migrations/20180801185500_create_spam_logs_table.js

15 lines
556 B
JavaScript

exports.up = async function(knex, Promise) {
if (! await knex.schema.hasTable('spam_logs')) {
await knex.schema.createTable('spam_logs', table => {
table.string('id', 36).notNullable().primary();
table.string('guild_id', 20).notNullable();
table.text('body', 'mediumtext').notNullable();
table.dateTime('created_at').defaultTo(knex.raw('NOW()')).notNullable();
table.dateTime('expires_at').nullable();
});
}
};
exports.down = async function(knex, Promise) {
await knex.schema.dropTableIfExists('spam_logs');
};