full blown pg

This commit is contained in:
ntr committed 2022-07-26 00:42:47 +10:00
1 parent 245616acd4
commit dde9646179
13 files changed
+323 -175

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
exports.up = async knex => {
await knex.schema.createTable('wants', table => {
table.uuid('id')
.primary()
.defaultTo(knex.raw('gen_random_uuid()'));
table.integer('release')
.notNullable()
.index();
table.uuid('user')
table.foreign('user')
.references('id')
.inTable('users')
.onDelete('CASCADE');
table.jsonb('data')
.notNullable();
// user can only want a release once
table.unique(['user', 'release']);
table.timestamps(true, true);
});
};
exports.down = async () => true;