Skip to content

Commit

Permalink
To satisfy Lucia, use TEXT for session and user ID types. We will wan…
Browse files Browse the repository at this point in the history
…t to move these queries into the database package so we can get test coverage over them.
  • Loading branch information
danielnaab committed Aug 20, 2024
1 parent 0460367 commit 10b9c83
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
*/
export async function up(knex) {
await knex.schema.createTable('users', table => {
table.uuid('id').primary(); //.defaultTo(knex.raw('gen_random_uuid()'));
//table.uuid('id').primary(); //.defaultTo(knex.raw('gen_random_uuid()'));
table.text('id').primary();
table.string('email').notNullable().unique();
table.timestamps(true, true);
});

await knex.schema.createTable('sessions', table => {
table.uuid('id').primary(); //.defaultTo(knex.raw('gen_random_uuid()'));
//table.uuid('id').primary(); //.defaultTo(knex.raw('gen_random_uuid()'));
table.text('id').primary();
table
.uuid('user_id')
.text('user_id')
.notNullable()
.references('id')
.inTable('users')
Expand Down

0 comments on commit 10b9c83

Please sign in to comment.