Skip to content

Commit

Permalink
Merge pull request #32 from icefoganalytics/main
Browse files Browse the repository at this point in the history
Ignore latest migration
  • Loading branch information
datajohnson authored Jul 30, 2024
2 parents c865f7e + 13c9fbd commit 6f8692f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 37 deletions.
41 changes: 19 additions & 22 deletions api/src/data/migrations/001.create-users-table.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import * as knex from "knex";

export async function up(knex: knex.Knex) {
await knex.schema.createTable("users", function(table) {
table.increments("id").notNullable().primary();
table.string("email", 250).notNullable();
table.string("auth_subject", 250).notNullable();
table.string("first_name", 100);
table.string("last_name", 100);
table.string("display_name", 200);
table.string("title", 100);
table.string("department", 100);
table.string("division", 100);
table.string("branch", 100);
table.string("unit", 100);
table.boolean("is_active").defaultTo(true).notNullable();
await knex.schema.createTable("users", function (table) {
table.increments("id").notNullable().primary();
table.string("email", 250).notNullable();
table.string("auth_subject", 250).notNullable();
table.string("first_name", 100);
table.string("last_name", 100);
table.string("display_name", 200);
table.string("title", 100);
table.string("department", 100);
table.string("division", 100);
table.string("branch", 100);
table.string("unit", 100);
table.boolean("is_active").defaultTo(true).notNullable();

table.unique(["email"], {
indexName: "unique_users_email",
});
table.unique(["auth_subject"], {
indexName: "unique_users_auth_subject",
});
table.unique(["email"], {
indexName: "unique_users_email",
});
};
});
}

export async function down(knex: knex.Knex) {
await knex.schema.dropTable("users");
};
await knex.schema.dropTable("users");
}
15 changes: 0 additions & 15 deletions api/src/data/migrations/029.drop_auth_index.ts

This file was deleted.

0 comments on commit 6f8692f

Please sign in to comment.