feat: store whether registration is open

This commit is contained in:
DiheChen committed 2026-11-08 21:48:23 +08:00
1 parent 0bc5568335
commit 4f056e91d4
10 files changed
+127 -55

No files matched your search

@@ -0,0 +1,5 @@
-- +goose Up
-- site 表没有行或者 brand_name 为 NULL 时,品牌名是默认的 Alisten;没有行时开放注册。
ALTER TABLE site
ALTER COLUMN brand_name DROP NOT NULL,
ADD COLUMN registration_open boolean NOT NULL DEFAULT true;
+6 -2
View File
@@ -1,6 +1,10 @@
-- name: BrandName :one
SELECT brand_name FROM site;
-- name: SiteSettings :one
SELECT brand_name, registration_open FROM site;
-- name: SetBrandName :exec
INSERT INTO site (brand_name) VALUES (@brand_name)
ON CONFLICT (id) DO UPDATE SET brand_name = excluded.brand_name;
-- name: SetRegistrationOpen :exec
INSERT INTO site (registration_open) VALUES (@registration_open)
ON CONFLICT (id) DO UPDATE SET registration_open = excluded.registration_open;