Skip to content

Commit

Permalink
chore: Update migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Mar 10, 2024
1 parent baed776 commit a2a9d28
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions migrations/models/5_20240310120549_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
async def upgrade(db) -> str:
return """
CREATE TABLE IF NOT EXISTS "notesnotify" (
"id" SERIAL NOT NULL PRIMARY KEY,
"type" SMALLINT NOT NULL,
"enabled" BOOL NOT NULL DEFAULT True,
"last_notif_time" TIMESTAMPTZ,
"last_check_time" TIMESTAMPTZ,
"est_time" TIMESTAMPTZ,
"notify_interval" SMALLINT NOT NULL,
"check_interval" SMALLINT NOT NULL,
"max_notif_count" SMALLINT NOT NULL DEFAULT 5,
"current_notif_count" SMALLINT NOT NULL DEFAULT 0,
"threshold" SMALLINT,
"notify_time" SMALLINT,
"notify_weekday" SMALLINT,
"account_id" INT NOT NULL REFERENCES "hoyoaccount" ("id") ON DELETE CASCADE,
CONSTRAINT "uid_notesnotify_type_0526b8" UNIQUE ("type", "account_id")
);
COMMENT ON COLUMN "notesnotify"."type" IS 'RESIN: 1\nREALM_CURRENCY: 2\nTB_POWER: 3\nGI_EXPED: 4\nHSR_EXPED: 5\nPT: 6\nGI_DAILY: 7\nHSR_DAILY: 8\nRESIN_DISCOUNT: 9\nECHO_OF_WAR: 10\nRESERVED_TB_POWER: 11';"""


async def downgrade(db) -> str:
return """
DROP TABLE IF EXISTS "notesnotify";"""

0 comments on commit a2a9d28

Please sign in to comment.