Add structured admission plans and school role management

This commit is contained in:
2026-07-21 14:04:19 +08:00 Unverified
parent 1b6e860013
commit 5e0bee60e2
23 changed files with 483 additions and 82 deletions
+10
View File
@@ -22,6 +22,8 @@ export const sqliteSchema = `
name TEXT NOT NULL UNIQUE,
code TEXT NOT NULL UNIQUE,
address TEXT,
is_source_school INTEGER NOT NULL DEFAULT 1 CHECK (is_source_school IN (0, 1)),
is_admission_school INTEGER NOT NULL DEFAULT 1 CHECK (is_admission_school IN (0, 1)),
active INTEGER NOT NULL DEFAULT 1 CHECK (active IN (0, 1))
) STRICT;
@@ -90,6 +92,8 @@ export const sqliteSchema = `
postal_code TEXT,
guardian_name TEXT,
guardian_phone TEXT,
specialty_category TEXT,
specialty_type TEXT,
specialty_types TEXT NOT NULL DEFAULT '[]',
specialty_certificate TEXT,
policy_eligibility TEXT,
@@ -174,6 +178,7 @@ export const sqliteSchema = `
review_note TEXT,
registration_number TEXT,
number_rule_id TEXT,
feature_score REAL NOT NULL DEFAULT 0 CHECK (feature_score >= 0),
UNIQUE (user_id, exam_id)
) STRICT;
@@ -521,6 +526,8 @@ export const mysqlSchema = [
name VARCHAR(160) NOT NULL,
code VARCHAR(40) NOT NULL,
address VARCHAR(255) NULL,
is_source_school BOOLEAN NOT NULL DEFAULT TRUE,
is_admission_school BOOLEAN NOT NULL DEFAULT TRUE,
active BOOLEAN NOT NULL DEFAULT TRUE,
PRIMARY KEY (id),
UNIQUE KEY uq_schools_name (name),
@@ -602,6 +609,8 @@ export const mysqlSchema = [
postal_code VARCHAR(20) NULL,
guardian_name VARCHAR(100) NULL,
guardian_phone VARCHAR(60) NULL,
specialty_category VARCHAR(30) NULL,
specialty_type VARCHAR(40) NULL,
specialty_types JSON NOT NULL DEFAULT (JSON_ARRAY()),
specialty_certificate VARCHAR(255) NULL,
policy_eligibility VARCHAR(255) NULL,
@@ -706,6 +715,7 @@ export const mysqlSchema = [
review_note VARCHAR(500) NULL,
registration_number VARCHAR(120) NULL,
number_rule_id VARCHAR(64) NULL,
feature_score DECIMAL(8,2) NOT NULL DEFAULT 0,
PRIMARY KEY (id),
UNIQUE KEY uq_registrations_user_exam (user_id, exam_id),
KEY idx_registrations_status (status),