salix/db/versions/10898-workerActivity/00-table.sql

13 lines
484 B
SQL

-- Place your SQL code here
CREATE TABLE vn.workerActivity (
id INT PRIMARY KEY AUTO_INCREMENT,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
model ENUM('COM', 'ENT', 'TPV', 'ENC', 'LAB', 'ETI') NOT NULL,
workerFk INT(10) UNSIGNED NOT NULL,
event ENUM('open', 'close', 'insert', 'delete', 'update', 'refresh') NOT NULL,
description VARCHAR(255) DEFAULT NULL,
CONSTRAINT fk_workerActivity_worker FOREIGN KEY (workerFk)
REFERENCES vn.worker (id)
ON DELETE CASCADE
ON UPDATE CASCADE
);