ALTER TABLE amb_chat_messages MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_company_login MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_company_login MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_functionality MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_functionality MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_profile MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_profile MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_right MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_right MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_user MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_user MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_user_profile MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_user_profile MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_user_project MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_user_project MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_tag MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_tag MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_class MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_class MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_follow_up MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_follow_up MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_opportunity MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_opportunity MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_opportunity_status MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_opportunity_status MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_prospection MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_prospection MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_type_follow_up MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_type_follow_up MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_contact_sector MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_contact_sector MODIFY updated_at TIMESTAMP(0);
ALTER TABLE ptk_daily MODIFY created_at TIMESTAMP(0);
ALTER TABLE ptk_daily MODIFY updated_at TIMESTAMP(0);
ALTER TABLE ptk_daily_task MODIFY created_at TIMESTAMP(0);
ALTER TABLE ptk_daily_task MODIFY updated_at TIMESTAMP(0);
ALTER TABLE ptk_ticket MODIFY created_at TIMESTAMP(0);
ALTER TABLE ptk_ticket MODIFY updated_at TIMESTAMP(0);
ALTER TABLE ptk_ticket_task_hours MODIFY created_at TIMESTAMP(0);
ALTER TABLE ptk_ticket_task_hours MODIFY updated_at TIMESTAMP(0);
ALTER TABLE amb_schedule MODIFY created_at TIMESTAMP(0);
ALTER TABLE amb_schedule MODIFY updated_at TIMESTAMP(0);
ALTER TABLE crm_follow_up_distance MODIFY created_at TIMESTAMP(0);
ALTER TABLE crm_follow_up_distance MODIFY updated_at TIMESTAMP(0);

incluir tabelas:
CREATE TABLE amb_form (
    id INT AUTO_INCREMENT PRIMARY KEY,
    nameform VARCHAR(255) NOT NULL,
    description TEXT,
    help TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
    created_user VARCHAR(100),
    updated_user VARCHAR(100)
);

CREATE TABLE amb_user_autoriza (
    id INT AUTO_INCREMENT PRIMARY KEY,
    amb_user_id INT NOT NULL,
    amb_form_id INT NOT NULL,
    direitos VARCHAR(7),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
    created_user VARCHAR(100),
    updated_user VARCHAR(100),
    CONSTRAINT fk_user_autoriza_user FOREIGN KEY (amb_user_id) REFERENCES amb_user(id),
    CONSTRAINT fk_user_autoriza_form FOREIGN KEY (amb_form_id) REFERENCES amb_form(id)
);

CREATE TABLE amb_profile_autoriza (
    id INT AUTO_INCREMENT PRIMARY KEY,
    amb_profile_id INT NOT NULL,
    amb_form_id INT NOT NULL,
    direitos VARCHAR(7),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
    created_user VARCHAR(100),
    updated_user VARCHAR(100),
    CONSTRAINT fk_profile_autoriza_profile FOREIGN KEY (amb_profile_id) REFERENCES amb_profile(id),
    CONSTRAINT fk_profile_autoriza_form FOREIGN KEY (amb_form_id) REFERENCES amb_form(id)
);

CREATE TABLE amb_user_profile (
    id INT AUTO_INCREMENT PRIMARY KEY,
    amb_profile_id INT NOT NULL,
    amb_user_id INT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
    created_user VARCHAR(100),
    updated_user VARCHAR(100),
    CONSTRAINT fk_user_profile_profile FOREIGN KEY (amb_profile_id) REFERENCES amb_profile(id),
    CONSTRAINT fk_user_profile_user FOREIGN KEY (amb_user_id) REFERENCES amb_user(id)
);


ALTER TABLE `ptk_ticket` 
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ;

ALTER TABLE `ptk_ticket` 
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP ;


ALTER TABLE amb_action ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_chat_messages ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_company_login ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_message_attachments ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_personal_access_tokens ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_schedule ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE amb_tag ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE crm_follow_up_distance ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE crm_funil ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE crm_opportunity_tag ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE crm_tag ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE ptk_status_type ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
ALTER TABLE ptk_ticket_sprint ADD COLUMN created_user INT NULL, ADD COLUMN updated_user INT NULL;
