full blown pg
This commit is contained in:
1 parent
245616acd4
commit
dde9646179
13 files changed
+323
-175
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user