mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: add 'startMinimized' property to user preferences
This commit is contained in:
parent
0a86ec89aa
commit
6dd454a982
@ -35,6 +35,9 @@ export class UserPreferences {
|
||||
@Column("boolean", { default: false })
|
||||
runAtStartup: boolean;
|
||||
|
||||
@Column("boolean", { default: false })
|
||||
startMinimized: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
|
@ -11,7 +11,7 @@ import { AddAchievementNotificationPreference } from "./migrations/2024101301290
|
||||
import { CreateUserSubscription } from "./migrations/20241015235142_create_user_subscription";
|
||||
import { AddBackgroundImageUrl } from "./migrations/20241016100249_add_background_image_url";
|
||||
import { AddWinePrefixToGame } from "./migrations/20241019081648_add_wine_prefix_to_game";
|
||||
|
||||
import { QualityOfLife } from "./migrations/20241030171454_quality_of_life";
|
||||
export type HydraMigration = Knex.Migration & { name: string };
|
||||
|
||||
class MigrationSource implements Knex.MigrationSource<HydraMigration> {
|
||||
@ -27,6 +27,7 @@ class MigrationSource implements Knex.MigrationSource<HydraMigration> {
|
||||
CreateUserSubscription,
|
||||
AddBackgroundImageUrl,
|
||||
AddWinePrefixToGame,
|
||||
QualityOfLife,
|
||||
]);
|
||||
}
|
||||
getMigrationName(migration: HydraMigration): string {
|
||||
|
17
src/main/migrations/20241030171454_quality_of_life.ts
Normal file
17
src/main/migrations/20241030171454_quality_of_life.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import type { HydraMigration } from "@main/knex-client";
|
||||
import type { Knex } from "knex";
|
||||
|
||||
export const QualityOfLife: HydraMigration = {
|
||||
name: "QualityOfLife",
|
||||
up: (knex: Knex) => {
|
||||
return knex.schema.alterTable("user_preferences", (table) => {
|
||||
return table.boolean("startMinimized").notNullable().defaultTo(0);
|
||||
});
|
||||
},
|
||||
|
||||
down: async (knex: Knex) => {
|
||||
return knex.schema.alterTable("user_preferences", (table) => {
|
||||
return table.dropColumn("startMinimized");
|
||||
});
|
||||
},
|
||||
};
|
@ -160,6 +160,7 @@ export interface UserPreferences {
|
||||
realDebridApiToken: string | null;
|
||||
preferQuitInsteadOfHiding: boolean;
|
||||
runAtStartup: boolean;
|
||||
startMinimized: boolean;
|
||||
}
|
||||
|
||||
export interface Steam250Game {
|
||||
|
Loading…
Reference in New Issue
Block a user