refactor: rename all "popup" strings to "alert"

This commit is contained in:
Hachi-R
2024-11-06 20:44:56 -03:00
parent e7acce2dfc
commit aaee27732d
8 changed files with 16 additions and 16 deletions

View File

@@ -39,7 +39,7 @@ export class UserPreferences {
startMinimized: boolean;
@Column("boolean", { default: false })
disableNsfwPopup: boolean;
disableNsfwAlert: boolean;
@CreateDateColumn()
createdAt: Date;

View File

@@ -12,7 +12,7 @@ import { CreateUserSubscription } from "./migrations/20241015235142_create_user_
import { AddBackgroundImageUrl } from "./migrations/20241016100249_add_background_image_url";
import { AddWinePrefixToGame } from "./migrations/20241019081648_add_wine_prefix_to_game";
import { AddStartMinimizedColumn } from "./migrations/20241030171454_add_start_minimized_column";
import { AddDisableNsfwPopupColumn } from "./migrations/20241106053733_add_disable_nsfw_popup_column";
import { AddDisableNsfwAlertColumn } from "./migrations/20241106053733_add_disable_nsfw_alert_column";
export type HydraMigration = Knex.Migration & { name: string };
class MigrationSource implements Knex.MigrationSource<HydraMigration> {
@@ -29,7 +29,7 @@ class MigrationSource implements Knex.MigrationSource<HydraMigration> {
AddBackgroundImageUrl,
AddWinePrefixToGame,
AddStartMinimizedColumn,
AddDisableNsfwPopupColumn,
AddDisableNsfwAlertColumn,
]);
}
getMigrationName(migration: HydraMigration): string {

View File

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