feat: add option to disable NSFW warning

This commit is contained in:
Hachi-R
2024-11-06 02:57:52 -03:00
parent b09e91a1cf
commit 2f8fe67f9f
6 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import type { HydraMigration } from "@main/knex-client";
import type { Knex } from "knex";
export const AddDisableNsfwPopupColumn: HydraMigration = {
name: "AddDisableNsfwPopupColumn",
up: (knex: Knex) => {
return knex.schema.alterTable("user_preferences", (table) => {
return table.boolean("disableNsfwPopup").notNullable().defaultTo(0);
});
},
down: async (knex: Knex) => {
return knex.schema.alterTable("user_preferences", (table) => {
return table.dropColumn("disableNsfwPopup");
});
},
};