20200730203154_expire_in.js 300 B

1234567891011121314151617
  1. async function up(knex) {
  2. const hasExpireIn = await knex.schema.hasColumn("links", "expire_in");
  3. if (!hasExpireIn) {
  4. await knex.schema.alterTable("links", table => {
  5. table.dateTime("expire_in");
  6. });
  7. }
  8. }
  9. async function down() {
  10. return null;
  11. }
  12. module.exports = {
  13. up,
  14. down
  15. }