File size: 923 Bytes
1e220c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- Migration: 010_project_feedback
-- Description: Creates the tables backing the in-app "Rate Your Experience"
-- ratings and the customer complaints box. These were only defined in the
-- local SQLite bootstrap, so on MySQL the inserts (and the admin panel that
-- reads them) had no table to hit. IF NOT EXISTS keeps this safe if a table
-- was already created manually in production.

CREATE TABLE IF NOT EXISTS qto_project_feedback (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL,
    tool_name VARCHAR(100) NOT NULL,
    project_name VARCHAR(255) NOT NULL,
    rating INT NOT NULL,
    reason TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS qto_customer_complaints (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL,
    complaint_text TEXT NOT NULL,
    status VARCHAR(50) DEFAULT 'open',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);