-- migrate:up
CREATE TABLE crm_contact (
    id INT AUTO_INCREMENT PRIMARY KEY,
    crm_group_contact_id INT DEFAULT NULL,
    name VARCHAR(100) NOT NULL,
    phone_number VARCHAR(15) NOT NULL UNIQUE,
    email VARCHAR(100) NULL,
    is_template BOOLEAN DEFAULT TRUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (crm_group_contact_id) REFERENCES crm_group_contact(id)
);

INSERT INTO crm_contact (name, phone_number, email, is_template)
VALUES ('Wiselie Admin', '6282196175505', 'admin@wiselie.co.id', FALSE);

-- migrate:down
DROP TABLE IF EXISTS crm_contact;
