CREATE TABLE employee
(
    id               BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    is_active        TINYINT UNSIGNED DEFAULT '1'               NOT NULL,
    company_id       BIGINT UNSIGNED  DEFAULT '0'               NOT NULL,
    dni              VARCHAR(30)                                NOT NULL,
    full_name        VARCHAR(100)                               NOT NULL,
    work_position_id INT UNSIGNED     DEFAULT '0'               NOT NULL,
    created_at       TIMESTAMP        DEFAULT CURRENT_TIMESTAMP NOT NULL,
    updated_at       TIMESTAMP        DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
    CONSTRAINT dni_cid UNIQUE (company_id, dni)
);

CREATE INDEX dni_idx ON employee (dni);

