GeoNetAgent, LDAPWeb, server-audit, server-connection
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.2 KiB

---
description: Aturan database — koneksi, migration, naming
globs: ["geonet-console/database/**", "geonet-console/app/Models/**", "geonet-console/config/database.php"]
alwaysApply: false
---
# Database Rules — geonet-console
## Koneksi
| Name | DB | Host |
|------|----|------|
| `pgsql` (default) | `databaselist_app` | `audit-postgres` container |
| `audit` | `databaselist_audit` | `audit-postgres` container |
| `mssql` | `master` | 10.100.1.25:1433 (read-only) |
| `project_search` | `geonet_project_search` | 10.100.1.25 (Fase 4) |
## Larangan
- ❌ JANGAN ubah `DB_CONNECTION` ke `sqlite`
- ❌ JANGAN jalankan `migrate:fresh` di production
- ❌ JANGAN tulis ke `mssql` — read-only
## Migration Convention
- File: `YYYY_MM_DD_HHMMSS_verb_noun_table.php`
- Nama tabel: `snake_case` plural
- Selalu buat rollback (`down()`) yang benar
- Gunakan `connection('audit')` untuk migration audit DB
## Naming
| Tipe | Konvensi |
|------|----------|
| Tabel | `snake_case` plural |
| Kolom | `snake_case` |
| FK | `<table_singular>_id` |
| Timestamp | `*_at` suffix (`created_at`, `last_used_at`) |
## Audit Log Wajib
Setiap aksi write wajib log via:
```php
AuditLogService::log($actor, $action, $target, $payload);
```