feat: Add SQL scripts for complete database reset and initialization, including table and function definitions for sessions, chat history, handoff records, and sbar drafts. Implement foreign key constraints and triggers for automatic session management and updated timestamps.
2f230ab
| -- ===================================================== | |
| -- κΈ°μ‘΄ ν μ΄λΈ λ° μ μ½μ‘°κ±΄ λͺ¨λ μμ (μλ‘ μμ) | |
| -- ===================================================== | |
| -- μμλλ‘ CASCADE μμ | |
| DROP TABLE IF EXISTS sessions CASCADE; | |
| DROP TABLE IF EXISTS sbar_drafts CASCADE; | |
| DROP TABLE IF EXISTS chat_history CASCADE; | |
| DROP TABLE IF EXISTS handoff_records CASCADE; | |
| DROP TABLE IF EXISTS scenarios CASCADE; | |
| DROP TABLE IF EXISTS patients CASCADE; | |
| -- ν¨μλ μμ (λμ€μ μ¬μμ±) | |
| DROP FUNCTION IF EXISTS update_updated_at_column() CASCADE; | |
| DROP FUNCTION IF EXISTS update_session_ended_at() CASCADE; | |
| DROP FUNCTION IF EXISTS auto_create_session() CASCADE; |