✅ 1. Tabel: users
Untuk menyimpan user aplikasi.

Field	Type	Notes
id (PK)	uuid	
name	varchar(150)	
email	varchar(150)	unique
password_hash	text	
role_id (FK)	uuid	
status	enum(active, inactive)	default active
created_at	timestamp	
updated_at	timestamp	

-------------------------------------------

✅ 2. Tabel: role
Field	Type
id (PK)	uuid
name	varchar(100)
description	text
created_at	timestamp
updated_at	timestamp

-------------------------------------------

✅ 3. Tabel: campaign_type

Jenis campaign umum (misalnya: artikel, short video, banner digital, publikasi medsos)

Field	Type
id (PK)	uuid
name	varchar(150)
description	text
created_at	timestamp
updated_at	timestamp

-------------------------------------------

✅ 4. Tabel: campaign_destination

Tujuan publikasi spesifik sesuai media/platform.

Contoh:

Website → news section

Instagram → feed, reels, story

Videotron → LED Baliho Jl Gatot Subroto

Twitter/X → timeline

Field	Type	Notes
id (PK)	uuid	
campaign_type_id (FK)	uuid	untuk mengelompokkan
sub_type	varchar(100)	IG Feed, Stories, TikTok, Videotron Mandiri Tower
name	varchar(150)	nama tujuan
description	text	
url	varchar(255)	opsional
is_active	boolean	default true
created_at	timestamp	
updated_at	timestamp	

-------------------------------------------

✅ 5. Tabel: campaign

Tabel utama campaign/artikel/post.

Field	Type	Notes
id (PK)	uuid	
title	varchar(255)	tambahan
campaign_type_id (FK)	uuid	
start_date	date	
end_date	date	
media_type_selected	varchar(100)	ex: web, medsos, videotron
media_item_selected	uuid / json	saran: bisa FK ke destination atau JSON array
purpose	text	
media_promote	boolean	yes/no
description	text	
creator_id (FK)	uuid	user pembuat
status	enum(draft, waiting_approval, approved, rejected, published, archived)	workflow
created_at	timestamp	
updated_at	timestamp	

-------------------------------------------

✅ 6. Tabel: campaign_file

Untuk file atau URL yang digunakan dalam campaign.

Field	Type
id (PK)	uuid
campaign_id (FK)	uuid
type	enum(url, file)
file_url	text
external_url	text
is_draft	boolean
is_publish	boolean
created_at	timestamp
updated_at	timestamp

-------------------------------------------

✅ 7. Tabel: campaign_destination_relation

Relasi campaign → media tujuan

Campaign bisa di-post ke banyak tempat sekaligus.

Field	Type
id (PK)	uuid
campaign_id (FK)	uuid
destination_id (FK)	uuid
scheduled_at	timestamp
publish_status	enum(pending, success, failed)
publish_response	text
created_at	timestamp
updated_at	timestamp

-------------------------------------------

✅ 8. Tabel: campaign_approval

Untuk workflow persetujuan.

Field	Type
id (PK)	uuid
campaign_id (FK)	uuid
approver_id (FK)	uuid
status	enum(pending, approved, rejected)
notes	text
created_at	timestamp

-------------------------------------------

✅ 9. Tabel: campaign_chat

Chat internal antar user di setiap campaign (komentar, diskusi revisi).

Field	Type
id (PK)	uuid
campaign_id (FK)	uuid
sender_id (FK)	uuid
message	text
attachment_url	text
created_at	timestamp