Add waiting system application files
- Add main application files (main.py, models.py, schemas.py, etc.) - Add routers for all features (waiting, attendance, members, etc.) - Add HTML templates for admin and user interfaces - Add migration scripts and utility files - Add Docker configuration - Add documentation files - Add .gitignore to exclude database and cache files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
40
migrate_add_class_closure.py
Normal file
40
migrate_add_class_closure.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
데이터베이스 마이그레이션: class_closure 테이블 추가
|
||||
"""
|
||||
import sqlite3
|
||||
|
||||
def migrate():
|
||||
# 데이터베이스 연결
|
||||
conn = sqlite3.connect('waiting_system.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
try:
|
||||
# class_closure 테이블 생성
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS class_closure (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
business_date DATE NOT NULL,
|
||||
class_id INTEGER NOT NULL,
|
||||
closed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (class_id) REFERENCES class_info (id)
|
||||
)
|
||||
''')
|
||||
|
||||
# 인덱스 생성
|
||||
cursor.execute('''
|
||||
CREATE INDEX IF NOT EXISTS idx_class_closure_business_date
|
||||
ON class_closure (business_date)
|
||||
''')
|
||||
|
||||
conn.commit()
|
||||
print("✅ 마이그레이션 성공: class_closure 테이블이 추가되었습니다.")
|
||||
|
||||
except sqlite3.OperationalError as e:
|
||||
print(f"❌ 마이그레이션 실패: {e}")
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
migrate()
|
||||
Reference in New Issue
Block a user