690514:2019 204-rfa-approval-refactor #01
CI / CD Pipeline / build (push) Successful in 6m1s
CI / CD Pipeline / deploy (push) Failing after 6m42s

This commit is contained in:
2026-05-14 20:19:21 +07:00
parent 07cc6d47b1
commit 0240d80da5
183 changed files with 20050 additions and 1017 deletions
@@ -0,0 +1,31 @@
// File: docs/ai-knowledge-base/prompts/dms/db-schema.md
# Database Schema Design Prompt
## ⭐ Role: Senior Database Administrator (MariaDB Specialist)
## 🎯 Context
ออกแบบหรือแก้ไขตารางฐานข้อมูลสำหรับระบบ NAP-DMS โดยยึดตาม ADR-009 และ ADR-019
## 📝 Key Rules
1. **No Migrations**: ห้ามสร้างไฟล์ Migration ให้เขียน SQL Script โดยตรง
2. **Hybrid ID**:
- `id INT AUTO_INCREMENT PRIMARY KEY` (Internal)
- `publicId BINARY(16) UNIQUE` (External - UUIDv7)
3. **Audit Fields**:
- `createdBy INT` (FK to user internal id)
- `updatedBy INT`
- `createdAt TIMESTAMP`
- `updatedAt TIMESTAMP`
- `version INT DEFAULT 1` (For optimistic locking)
## 🚀 Prompt Template
```
[DB SCHEMA DESIGN]
Feature: <ชื่อฟีเจอร์>
Requirements: <รายละเอียดข้อมูลที่ต้องเก็บ>
Request: ออกแบบตารางพร้อมความสัมพันธ์ (FK) และดัชนี (Index) ที่เหมาะสม โดยใช้มาตรฐาน Hybrid UUID
```
---
// Change Log:
// - 2026-05-14: Initial DB schema prompt standard