CREATE TABLE issues(
id INT PRIMARY KEY auto_increment COMMENT 'primary key',
project_id INT COMMENT 'project id',
issue_type INT COMMENT 'Issue type',
phenomenon_type INT COMMENT 'Phenomenon type',
title VARCHAR(1024) COMMENT 'Title',
description TEXT COMMENT 'description',
ver INT COMMENT 'update version',
priority INT COMMENT 'Issue priority',
severity INT COMMENT 'Issue severity',
scale INT COMMENT 'Issue scale',
status INT COMMENT 'status',
registed DATETIME COMMENT 'registed date by user',
start_date DATETIME COMMENT 'datetime of the onset',
deadline DATETIME COMMENT 'deadline',
estimate INT COMMENT 'estimate of cost time',
cost INT COMMENT 'fact cost time',
note TEXT COMMENT 'note',
finished DATETIME COMMENT 'finished date',
approval_user INT COMMENT 'user of approval',
insert_time DATETIME COMMENT 'create datetime',
insert_user INT COMMENT 'create user',
update_time DATETIME COMMENT 'update datetime',
update_user INT COMMENT 'update user'
) type=InnoDB, COMMENT = 'Project issues'
;

CREATE INDEX issues_idx01 ON issues( project_id )
;

