-- =============================================
-- SQL Script untuk membuat tabel SR PAMSIMAS FOTOS
-- Database: sipracika
-- =============================================

-- Hapus tabel jika sudah ada (untuk testing, hati-hati di production)
-- DROP TABLE IF EXISTS `sr_pamsimas_fotos`;

-- =============================================
-- Tabel: sr_pamsimas_fotos
-- =============================================
CREATE TABLE IF NOT EXISTS `sr_pamsimas_fotos` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `sr_pamsimas_id` BIGINT UNSIGNED NOT NULL,
  `path` VARCHAR(500) NOT NULL,
  `created_at` TIMESTAMP NULL DEFAULT NULL,
  `updated_at` TIMESTAMP NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sr_pamsimas_fotos_sr_pamsimas_id_foreign` (`sr_pamsimas_id`),
  CONSTRAINT `sr_pamsimas_fotos_sr_pamsimas_id_foreign` FOREIGN KEY (`sr_pamsimas_id`) REFERENCES `sr_pamsimas` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- =============================================
-- Selesai
-- =============================================

