Files
omnisupport-ai/backend/schema.sql
fcarraUniSa 0102f0e285 feat: Initialize OmniSupport AI project structure
Sets up the basic project structure for OmniSupport AI, including:
- Vite build tool configuration.
- React and necessary dependencies.
- TypeScript configuration.
- Basic HTML and root component setup.
- Initial type definitions and mock data for core entities like tickets, agents, and queues.
- A README with setup instructions.
- A .gitignore file for common build artifacts and development files.
2026-02-16 16:24:31 +01:00

39 lines
1.2 KiB
SQL

CREATE TABLE IF NOT EXISTS agents (
id VARCHAR(36) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
role ENUM('superadmin', 'supervisor', 'agent') DEFAULT 'agent',
avatar TEXT,
queues JSON,
skills JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS client_users (
id VARCHAR(36) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
company VARCHAR(255),
status ENUM('active', 'inactive') DEFAULT 'active',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS tickets (
id VARCHAR(36) PRIMARY KEY,
subject VARCHAR(255) NOT NULL,
description TEXT,
status ENUM('APERTO', 'IN LAVORAZIONE', 'RISOLTO', 'CHIUSO') DEFAULT 'APERTO',
priority ENUM('Bassa', 'Media', 'Alta', 'Critica') DEFAULT 'Media',
customer_name VARCHAR(255),
assigned_agent_id VARCHAR(36),
queue VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert Default Superadmin if not exists
INSERT IGNORE INTO agents (id, name, email, password, role, queues) VALUES
('a0', 'Super Admin', 'fcarra79@gmail.com', 'Mr10921.', 'superadmin', '["General", "Tech Support", "Billing"]');