refactor: 移除WebSocket同步功能及相关代码

feat(theme): 增强侧边栏选中项样式配置
style: 优化主题变量和样式覆盖逻辑
chore: 清理未使用的依赖和配置文件
This commit is contained in:
Fox_block
2026-01-18 11:44:50 +08:00
parent b41139b941
commit e83f17af56
70 changed files with 4199 additions and 2173 deletions
@@ -0,0 +1,92 @@
import type { MigrationInterface, QueryRunner } from 'typeorm'
export class InitSchema2026011800000 implements MigrationInterface {
name = 'InitSchema2026011800000'
async up(queryRunner: QueryRunner): Promise<void> {
if (!(await queryRunner.hasTable('students'))) {
await queryRunner.query(`
CREATE TABLE "students" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"name" text NOT NULL,
"score" integer NOT NULL DEFAULT (0),
"extra_json" text,
"created_at" text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"updated_at" text NOT NULL DEFAULT (CURRENT_TIMESTAMP)
)
`)
}
if (!(await queryRunner.hasTable('reasons'))) {
await queryRunner.query(`
CREATE TABLE "reasons" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"content" text NOT NULL,
"category" text NOT NULL DEFAULT ('其他'),
"delta" integer NOT NULL,
"is_system" integer NOT NULL DEFAULT (0),
"updated_at" text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
CONSTRAINT "UQ_reasons_content" UNIQUE ("content")
)
`)
}
if (!(await queryRunner.hasTable('settlements'))) {
await queryRunner.query(`
CREATE TABLE "settlements" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"start_time" text NOT NULL,
"end_time" text NOT NULL,
"created_at" text NOT NULL DEFAULT (CURRENT_TIMESTAMP)
)
`)
}
if (!(await queryRunner.hasTable('score_events'))) {
await queryRunner.query(`
CREATE TABLE "score_events" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"uuid" text NOT NULL,
"student_name" text NOT NULL,
"reason_content" text NOT NULL,
"delta" integer NOT NULL,
"val_prev" integer NOT NULL,
"val_curr" integer NOT NULL,
"event_time" text NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"settlement_id" integer,
CONSTRAINT "UQ_score_events_uuid" UNIQUE ("uuid")
)
`)
}
await queryRunner.query(
`CREATE INDEX IF NOT EXISTS "IDX_score_events_settlement_id" ON "score_events" ("settlement_id")`
)
if (!(await queryRunner.hasTable('settings'))) {
await queryRunner.query(`
CREATE TABLE "settings" (
"key" text PRIMARY KEY NOT NULL,
"value" text
)
`)
}
await queryRunner.query(`
INSERT OR IGNORE INTO "reasons" ("content","category","delta","is_system","updated_at") VALUES
('上课发言','课堂表现',1,1,CURRENT_TIMESTAMP),
('作业优秀','作业情况',2,1,CURRENT_TIMESTAMP),
('纪律良好','纪律',1,1,CURRENT_TIMESTAMP),
('帮助同学','品德',2,1,CURRENT_TIMESTAMP),
('迟到','纪律',-1,1,CURRENT_TIMESTAMP),
('未交作业','作业情况',-2,1,CURRENT_TIMESTAMP)
`)
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE IF EXISTS "score_events"`)
await queryRunner.query(`DROP TABLE IF EXISTS "settlements"`)
await queryRunner.query(`DROP TABLE IF EXISTS "students"`)
await queryRunner.query(`DROP TABLE IF EXISTS "reasons"`)
await queryRunner.query(`DROP TABLE IF EXISTS "settings"`)
}
}