feat(crm): persist contact data imports

This commit is contained in:
2026-06-05 03:20:34 +08:00
parent ab2ca840fb
commit 8eed2f1943
10 changed files with 289 additions and 46 deletions
@@ -0,0 +1 @@
DROP TABLE IF EXISTS data_imports;
+19
View File
@@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS data_imports (
id INTEGER PRIMARY KEY,
account_id INTEGER NOT NULL,
user_id INTEGER,
data_type VARCHAR(100) NOT NULL,
status VARCHAR(50) NOT NULL DEFAULT 'pending',
total_records INTEGER NOT NULL DEFAULT 0,
processed_records INTEGER NOT NULL DEFAULT 0,
failed_records INTEGER NOT NULL DEFAULT 0,
processing_errors TEXT,
import_config JSONB DEFAULT '{}',
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
deleted_at TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_data_imports_account_id ON data_imports(account_id);
CREATE INDEX IF NOT EXISTS idx_data_imports_deleted_at ON data_imports(deleted_at);
CREATE INDEX IF NOT EXISTS idx_data_imports_user_id ON data_imports(user_id);