CREATE TABLE IF NOT EXISTS patient_notes (
  id INT PRIMARY KEY AUTO_INCREMENT,
  patient_id INT NOT NULL,
  note_type VARCHAR(50) DEFAULT 'genel' COMMENT 'Notun türü: genel, tıbbi, idari',
  content TEXT NOT NULL,
  created_by INT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT fk_patient_notes_patient FOREIGN KEY (patient_id) REFERENCES patients(id) ON DELETE CASCADE,
  KEY idx_patient_id (patient_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Hasta notları - birden fazla not destekler';
