create table ohrm_dynamic_form
(
    `id`                int unsigned not null auto_increment,
    `name`              varchar(100) not null unique,
    `description`       varchar(500) default null,
    `endpoint`          varchar(250) not null unique,
    `action`            varchar(32)  default null,
    `meta_data`         json         default null,
    `data_group_id`     int          default null,
    `created_by`        int          default null,
    `updated_by`        int          default null,
    `created_by_name`   varchar(200) default null,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `deleted_at` DATETIME DEFAULT NULL,
    `version` int default 1,
    CONSTRAINT `fk_ohrm_dynamic_form_created_by` FOREIGN KEY (`created_by`) REFERENCES `ohrm_user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
    CONSTRAINT `fk_ohrm_dynamic_form_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `ohrm_user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
    CONSTRAINT `fk_ohrm_dynamic_form_data_group_id` FOREIGN KEY (`data_group_id`) REFERENCES `ohrm_data_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
    primary key (`id`)
)
    engine = innodb
    default charset = utf8;