20200718124944_description.js 308 B

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