Add participant daily details migration and naming rules
This commit is contained in:
29
AGENTS.md
Normal file
29
AGENTS.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# AGENTS.md instructions for /Users/fajrihardhitamurti/REPO_CPONE_DASHBOARD
|
||||
|
||||
Kamu adalah teman fajri dalam ngoding, trading saham/crypto, dan urusan teknis harian. Fokus: cepat, tepat, tidak ngarang.
|
||||
|
||||
## Aturan commit/push
|
||||
- Kalau diminta `commit` dan `push`, lakukan inspeksi seminimal mungkin.
|
||||
- Saat menyiapkan commit/push, cek dulu:
|
||||
- `git status`
|
||||
- `git diff --stat`
|
||||
- Buat commit message singkat dan langsung `git push`.
|
||||
- Jangan tambah kerja tambahan yang tidak diminta user.
|
||||
|
||||
## Aturan penamaan table/kolom (cpone_dashboard)
|
||||
- Nama table wajib `snake_case` lowercase, contoh: `mcu_participant_daily_details`.
|
||||
- Nama kolom wajib pakai prefix entitas/tabel, jangan pakai nama generik tanpa prefix.
|
||||
- Untuk table `mcu_participant_daily_details`, gunakan pola kolom:
|
||||
- `Mcu_ParticipantDailyDetailsID`
|
||||
- `Mcu_ParticipantDailyDetailsParticipantDailyID`
|
||||
- `Mcu_ParticipantDailyDetailsMcu_PatientID`
|
||||
- `Mcu_ParticipantDailyDetailsIsActive`
|
||||
- `Mcu_ParticipantDailyDetailsCreated`
|
||||
- `Mcu_ParticipantDailyDetailsLastUpdated`
|
||||
- Standar default kolom:
|
||||
- `...IsActive CHAR(1) NOT NULL DEFAULT 'Y'`
|
||||
- `...Created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP`
|
||||
- `...LastUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`
|
||||
- Engine/charset standar:
|
||||
- `ENGINE=InnoDB`
|
||||
- `DEFAULT CHARSET=utf8mb4`
|
||||
50
clude.md
Normal file
50
clude.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Aturan Penulisan Table dan Kolom (cpone_dashboard)
|
||||
|
||||
## 1) Penamaan Table
|
||||
- Gunakan `snake_case` semua huruf kecil.
|
||||
- Gunakan prefix domain bila relevan: `mcu_...`, `dashboard_...`, `published_...`.
|
||||
- Nama table harus deskriptif dan konsisten dengan modul data.
|
||||
- Contoh benar:
|
||||
- `mcu_participant_daily`
|
||||
- `mcu_participant_daily_details`
|
||||
- `mcu_patient_resume_status`
|
||||
|
||||
## 2) Penamaan Kolom
|
||||
- Gunakan `PascalCase` dengan prefix entitas/tabel.
|
||||
- Pola utama:
|
||||
- `<EntityPrefix>ID` untuk primary key.
|
||||
- `<EntityPrefix><FieldName>` untuk field lain.
|
||||
- Hindari nama generik tanpa prefix seperti `IsActive`, `Created`, `LastUpdated`.
|
||||
- Contoh benar (table: `mcu_participant_daily_details`):
|
||||
- `Mcu_ParticipantDailyDetailsID`
|
||||
- `Mcu_ParticipantDailyDetailsParticipantDailyID`
|
||||
- `Mcu_ParticipantDailyDetailsMcu_PatientID`
|
||||
- `Mcu_ParticipantDailyDetailsIsActive`
|
||||
- `Mcu_ParticipantDailyDetailsCreated`
|
||||
- `Mcu_ParticipantDailyDetailsLastUpdated`
|
||||
|
||||
## 3) Kolom Status & Waktu (Standar)
|
||||
- Status aktif:
|
||||
- `...IsActive CHAR(1) NOT NULL DEFAULT 'Y'`.
|
||||
- Waktu buat:
|
||||
- `...Created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP`.
|
||||
- Waktu update terakhir:
|
||||
- `...LastUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`.
|
||||
|
||||
## 4) Key dan Index
|
||||
- Primary key wajib pada kolom `...ID`.
|
||||
- Tambahkan index pada kolom relasi/filter utama.
|
||||
- Nama index gunakan pola jelas:
|
||||
- `idx_<field>` untuk index biasa.
|
||||
- `uq_<context>` / `uk_<context>` untuk unique key.
|
||||
|
||||
## 5) Charset/Engine
|
||||
- Gunakan:
|
||||
- `ENGINE=InnoDB`
|
||||
- `DEFAULT CHARSET=utf8mb4`
|
||||
|
||||
## 6) Checklist Sebelum Buat Migration Baru
|
||||
- Pastikan nama table `snake_case`.
|
||||
- Pastikan semua kolom pakai prefix entitas (bukan nama generik).
|
||||
- Pastikan kolom ID, IsActive, Created, LastUpdated mengikuti standar.
|
||||
- Tambahkan index minimal untuk kolom relasi dan kolom filter utama.
|
||||
@@ -0,0 +1,14 @@
|
||||
-- Migration 013: create mcu_participant_daily_details
|
||||
|
||||
CREATE TABLE IF NOT EXISTS mcu_participant_daily_details (
|
||||
Mcu_ParticipantDailyDetailsID INT NOT NULL AUTO_INCREMENT,
|
||||
Mcu_ParticipantDailyDetailsParticipantDailyID INT NOT NULL,
|
||||
Mcu_ParticipantDailyDetailsMcu_PatientID INT NOT NULL,
|
||||
Mcu_ParticipantDailyDetailsIsActive CHAR(1) NOT NULL DEFAULT 'Y',
|
||||
Mcu_ParticipantDailyDetailsCreated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
Mcu_ParticipantDailyDetailsLastUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (Mcu_ParticipantDailyDetailsID),
|
||||
KEY idx_participant_daily_id (Mcu_ParticipantDailyDetailsParticipantDailyID),
|
||||
KEY idx_patient_id (Mcu_ParticipantDailyDetailsMcu_PatientID),
|
||||
KEY idx_active (Mcu_ParticipantDailyDetailsIsActive)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
Reference in New Issue
Block a user