Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragory committed Mar 31, 2021
2 parents 4544ac5 + 3105bbe commit 1647fdb
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/.vscode
/.idea
/node_modules
/config.*
!/config.example.ini
/welcome.png
/update.sh

# Config files
/config.*
*.config.ini
!/config.example.ini
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"ajv": "^6.12.4",
"eris": "https://github.com/Dragory/eris/archive/stickers-0.14.0.tar.gz",
"eris": "https://github.com/Dragory/eris/archive/0.14.0-stage-hotfix.tar.gz",
"express": "^4.17.1",
"helmet": "^4.1.1",
"humanize-duration": "^3.23.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
exports.up = async function(knex) {
await knex.schema.renameTable("moderator_role_overrides", "old_moderator_role_overrides");

await knex.schema.createTable("moderator_role_overrides", table => {
table.increments("id");
table.string("moderator_id", 20).notNullable();
table.string("thread_id", 36).nullable().defaultTo(null);
table.string("role_id", 20).notNullable();

table.unique(["moderator_id", "thread_id"]);
});

const rows = await knex.table("old_moderator_role_overrides")
.select();

await knex.table("moderator_role_overrides").insert(rows);

await knex.schema.dropTable("old_moderator_role_overrides");
};

exports.down = async function(knex) {
await knex.schema.renameTable("moderator_role_overrides", "new_moderator_role_overrides");

await knex.schema.createTable("moderator_role_overrides", table => {
table.string("moderator_id", 20);
table.string("thread_id", 36).nullable().defaultTo(null);
table.string("role_id", 20);

table.primary(["moderator_id", "thread_id"]);
});

const rows = await knex.table("new_moderator_role_overrides")
.select();

await knex.table("moderator_role_overrides").insert(rows.map(r => {
delete r.id;
return r;
}));

await knex.schema.dropTable("new_moderator_role_overrides");
};

0 comments on commit 1647fdb

Please sign in to comment.