Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed May 22, 2014
1 parent 4c8ed2b commit 7cd5365
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
15 changes: 3 additions & 12 deletions src/database/create-table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
(
Expand Down Expand Up @@ -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();

3 changes: 0 additions & 3 deletions src/database/update.sql

This file was deleted.

24 changes: 24 additions & 0 deletions src/database/update.v0.9.sql
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 7cd5365

Please sign in to comment.