20200810195255_change_email.ts 467 B

12345678910111213141516171819
  1. import { Knex } from "knex";
  2. export async function up(knex: Knex): Promise<any> {
  3. const hasChangeEmail = await knex.schema.hasColumn(
  4. "users",
  5. "change_email_token"
  6. );
  7. if (!hasChangeEmail) {
  8. await knex.schema.alterTable("users", table => {
  9. table.dateTime("change_email_expires");
  10. table.string("change_email_token");
  11. table.string("change_email_address");
  12. });
  13. }
  14. }
  15. export async function down(): Promise<any> {
  16. return null;
  17. }