feat(crm): persist contact data imports
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS data_imports;
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user