forked from DebaucheryLibrarian/traxxx
Added stash transfer tool.
This commit is contained in:
19
migrations/20230607231459_stash_unique.js
Normal file
19
migrations/20230607231459_stash_unique.js
Normal file
@@ -0,0 +1,19 @@
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('stashes', (table) => {
|
||||
table.unique(['user_id', 'slug']);
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
CREATE UNIQUE INDEX unique_primary ON stashes (user_id, "primary") WHERE ("primary" = TRUE);
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('stashes', (table) => {
|
||||
table.dropUnique(['user_id', 'slug']);
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
DROP INDEX unique_primary;
|
||||
`);
|
||||
};
|
||||
Reference in New Issue
Block a user