Added stash transfer tool.

This commit is contained in:
DebaucheryLibrarian
2023-06-08 01:16:44 +02:00
parent f7708e0740
commit 56534800d8
6 changed files with 242 additions and 5 deletions

View 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;
`);
};