Skip to content

Commit

Permalink
数据库建表SQL语句
Browse files Browse the repository at this point in the history
  • Loading branch information
today committed May 21, 2014
1 parent d309c5a commit ae3ef3a
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions src/DB/create.sql
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
CREATE TABLE t_booking(
id INT PRIMARY KEY AUTO_INCREMENT,
booking_date varchar(32) NOT NULL,
booking_index integer NOT NULL ,
name VARCHAR(64) NOT NULL ,
patient_id VARCHAR(64) NOT NULL ,
case_id VARCHAR(64) NOT NULL ,
mobile VARCHAR(64) NOT NULL ,
comment VARCHAR(256) NULL ,
treat_date DATETIME NOT NULL,
upload_date TIMESTAMP NULL DEFAULT now()
CREATE TABLE `t_booking` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`booking_date` varchar(32) NOT NULL,
`booking_index` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`patient_id` varchar(64) NOT NULL,
`case_id` varchar(64) NOT NULL,
`mobile` varchar(64) NOT NULL,
`comment` varchar(256) DEFAULT NULL,
`treat_date` datetime NOT NULL,
`upload_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE INDEX i_booking_date on t_booking(Booking_date);

CREATE UNIQUE INDEX i_booking_date on t_booking(BookingDate);
CREATE TABLE `t_patient` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`patient_id` int(11) DEFAULT NOT NULL,
`patient_name` varchar(64) NOT NULL,
`mobile` varchar(64) NOT NULL,
`comment` varchar(256) DEFAULT NULL,
`update_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE INDEX i_patient_name on t_patient(patient_name);
CREATE INDEX i_patient_mobile on t_patient(mobile);


CREATE TABLE `t_json` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`json_string` varchar(21000) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

CREATE TABLE `t_image` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`binarydata` BLOB ,
PRIMARY KEY (`id`)
) ;

0 comments on commit ae3ef3a

Please sign in to comment.