20200730203154_expire_in.ts 343 B

1234567891011121314
  1. import { Knex } from "knex";
  2. export async function up(knex: Knex): Promise<any> {
  3. const hasExpireIn = await knex.schema.hasColumn("links", "expire_in");
  4. if (!hasExpireIn) {
  5. await knex.schema.alterTable("links", table => {
  6. table.dateTime("expire_in");
  7. });
  8. }
  9. }
  10. export async function down(): Promise<any> {
  11. return null;
  12. }