Last change
on this file since 7f9b01c was 347d768, checked in by Dmitry Portnoy <dmp1488@…>, 10 years ago |
Add time_finished to the gameHistory table, switch the order of blue_score and red_score columns, and fix a foreign key name
|
-
Property mode
set to
100644
|
File size:
838 bytes
|
Rev | Line | |
---|
[53643ca] | 1 | SQL statements for creating the db tables are stored here
|
---|
| 2 |
|
---|
[fb894b4] | 3 | CREATE TABLE users (
|
---|
[53643ca] | 4 | id INT NOT NULL AUTO_INCREMENT,
|
---|
| 5 | name varchar(64) NOT NULL,
|
---|
| 6 | password binary(60) NOT NULL,
|
---|
| 7 | class INT unsigned DEFAULT NULL,
|
---|
| 8 | level INT unsigned NOT NULL DEFAULT 0,
|
---|
| 9 | experience INT unsigned NOT NULL DEFAULT 0,
|
---|
[5037b4b] | 10 | honor INT unsigned NOT NULL DEFAULT 0,
|
---|
| 11 | wins INT unsigned NOT NULL DEFAULT 0,
|
---|
| 12 | losses INT unsigned NOT NULL DEFAULT 0,
|
---|
[53643ca] | 13 | PRIMARY KEY (id),
|
---|
| 14 | UNIQUE KEY name (name)
|
---|
[fb894b4] | 15 | );
|
---|
[53643ca] | 16 |
|
---|
| 17 |
|
---|
| 18 | CREATE TABLE gameHistory (
|
---|
| 19 | id INT NOT NULL AUTO_INCREMENT,
|
---|
| 20 | user_id INT NOT NULL,
|
---|
| 21 | user_team INT NOT NULL,
|
---|
| 22 | blue_score INT NOT NULL,
|
---|
[347d768] | 23 | red_score INT NOT NULL,
|
---|
| 24 | time_finished INT unsigned NOT NULL,
|
---|
[53643ca] | 25 | PRIMARY KEY (id),
|
---|
| 26 | CONSTRAINT fk_users FOREIGN KEY
|
---|
[347d768] | 27 | fk_users (user_id)
|
---|
[53643ca] | 28 | REFERENCES users (id)
|
---|
| 29 | ON DELETE CASCADE
|
---|
| 30 | ON UPDATE CASCADE
|
---|
| 31 | );
|
---|
Note:
See
TracBrowser
for help on using the repository browser.