Implement public FAQ read endpoints and admin CRUD with RBAC, persistence, and migrations, then regenerate Swagger and add a complete Postman collection so frontend/admin teams can integrate and validate the feature end-to-end. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
558 B
SQL
15 lines
558 B
SQL
CREATE TABLE IF NOT EXISTS faqs (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
question TEXT NOT NULL,
|
|
answer TEXT NOT NULL,
|
|
category VARCHAR(100),
|
|
display_order INT NOT NULL DEFAULT 0,
|
|
status VARCHAR(20) NOT NULL DEFAULT 'ACTIVE' CHECK (status IN ('ACTIVE', 'INACTIVE')),
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_faqs_status ON faqs(status);
|
|
CREATE INDEX IF NOT EXISTS idx_faqs_category ON faqs(category);
|
|
CREATE INDEX IF NOT EXISTS idx_faqs_display_order ON faqs(display_order);
|