diff --git a/src/database/create-table.sql b/src/database/create-table.sql index 7c4dc1e..114a50a 100644 --- a/src/database/create-table.sql +++ b/src/database/create-table.sql @@ -110,6 +110,8 @@ CREATE TABLE tb_project group_id int(10) NULL, related_ids varchar(128) NOT NULL DEFAULT '', + update_time timestamp NOT NULL + DEFAULT now(), FOREIGN KEY(user_id) REFERENCES tb_user(id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -339,7 +341,7 @@ CREATE TABLE tb_notification DEFAULT 0, FOREIGN KEY(user_id) REFERENCES tb_user(id) -) +)ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE tb_corporation ( @@ -378,14 +380,3 @@ CREATE TABLE tb_group FOREIGN KEY(user_id) REFERENCES tb_user(id), FOREIGN KEY(production_line_id) REFERENCES tb_production_line(id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - - -ALTER TABLE tb_user -ADD COLUMN realname varchar(128) NOT NULL - DEFAULT ''; - -ALTER TABLE tb_project -ADD COLUMN update_time timestamp NOT NULL - DEFAULT now(); - diff --git a/src/database/update.sql b/src/database/update.sql deleted file mode 100644 index 8b2cf4c..0000000 --- a/src/database/update.sql +++ /dev/null @@ -1,3 +0,0 @@ - - 修改name由varchar(16)更新为(256) - \ No newline at end of file diff --git a/src/database/update.v0.9.sql b/src/database/update.v0.9.sql new file mode 100644 index 0000000..3c1d93e --- /dev/null +++ b/src/database/update.v0.9.sql @@ -0,0 +1,24 @@ +-- tb_user.name 由varchar(16) changed to varchar(256) + +ALTER TABLE tb_user +ALTER COLUMN name varchar(256) not NULL; + +-- new added table for notifications system: tb_notification + +CREATE TABLE tb_notification +( + id int(10) AUTO_INCREMENT NOT NULL + PRIMARY KEY, + user_id int(10) NOT NULL, + type_id smallint NOT NULL, + param1 varchar(128) NULL, + param2 varchar(128) NULL, + param3 text NULL, + create_time timestamp NOT NULL + DEFAULT now(), + + is_read smallint NOT NULL + DEFAULT 0, + + FOREIGN KEY(user_id) REFERENCES tb_user(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file