05.1 ปรบปรง backend ทงหมด และ frontend/login
This commit is contained in:
@@ -36,6 +36,7 @@ DROP TABLE IF EXISTS memorandum_details;
|
||||
DROP TABLE IF EXISTS minutes_of_meeting_details;
|
||||
DROP TABLE IF EXISTS rfi_details;
|
||||
DROP TABLE IF EXISTS rfa_items;
|
||||
DROP TABLE IF EXISTS rfas;
|
||||
DROP TABLE IF EXISTS technicaldocs;
|
||||
DROP TABLE IF EXISTS approve_codes;
|
||||
DROP TABLE IF EXISTS document_status_codes;
|
||||
@@ -422,6 +423,27 @@ CREATE TABLE rfa_items (
|
||||
CREATE INDEX idx_rfaitems_rfa ON rfa_items(rfa_corr_id);
|
||||
CREATE INDEX idx_rfaitems_techdoc ON rfa_items(technical_doc_id);
|
||||
|
||||
CREATE TABLE rfas (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
code VARCHAR(64) NULL,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
discipline VARCHAR(64) NULL,
|
||||
due_date DATE NULL,
|
||||
description TEXT NULL,
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'draft',
|
||||
owner_id INT UNSIGNED NULL,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_rfas_code (code),
|
||||
KEY idx_rfas_status_updated (status, updated_at),
|
||||
KEY idx_rfas_due_date (due_date),
|
||||
KEY idx_rfas_updated_at (updated_at),
|
||||
CONSTRAINT fk_rfas_owner
|
||||
FOREIGN KEY (owner_id) REFERENCES users(id)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- =========================================================
|
||||
-- CONTRACT DRAWINGS (normalized cat 1:M subcat; dwg → sub_cat)
|
||||
-- =========================================================
|
||||
|
||||
Reference in New Issue
Block a user