This commit is contained in:
admin
2026-01-17 11:08:57 +09:00
parent d8ec60629e
commit 6661c7ac89
10 changed files with 610 additions and 47 deletions

View File

@@ -14,7 +14,7 @@ def get_month_locks():
fiscal_year,
month,
is_locked,
locked_at,
(locked_at AT TIME ZONE 'UTC') AT TIME ZONE 'Asia/Tokyo' as locked_at,
locked_by
FROM month_locks
ORDER BY fiscal_year, month
@@ -39,11 +39,11 @@ def lock_month(fiscal_year: int, month: int):
locked_at,
locked_by
)
VALUES (%s, %s, true, NOW(), %s)
VALUES (%s, %s, true, CURRENT_TIMESTAMP AT TIME ZONE 'Asia/Tokyo', %s)
ON CONFLICT (fiscal_year, month)
DO UPDATE
SET is_locked = true,
locked_at = NOW(),
locked_at = CURRENT_TIMESTAMP AT TIME ZONE 'Asia/Tokyo',
locked_by = EXCLUDED.locked_by
""", (
fiscal_year,