Last change
on this file since 5037b4b was 5037b4b, checked in by Dmitry Portnoy <dmp1488@…>, 10 years ago |
Change the users table to make honor, wins, and losses all unsigned ints
|
-
Property mode
set to
100644
|
File size:
799 bytes
|
Line | |
---|
1 | SQL statements for creating the db tables are stored here
|
---|
2 |
|
---|
3 | CREATE TABLE users (
|
---|
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,
|
---|
10 | honor INT unsigned NOT NULL DEFAULT 0,
|
---|
11 | wins INT unsigned NOT NULL DEFAULT 0,
|
---|
12 | losses INT unsigned NOT NULL DEFAULT 0,
|
---|
13 | PRIMARY KEY (id),
|
---|
14 | UNIQUE KEY name (name)
|
---|
15 | );
|
---|
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 | red_score INT NOT NULL,
|
---|
23 | blue_score INT NOT NULL,
|
---|
24 | PRIMARY KEY (id),
|
---|
25 | CONSTRAINT fk_users FOREIGN KEY
|
---|
26 | fki_users (user_id)
|
---|
27 | REFERENCES users (id)
|
---|
28 | ON DELETE CASCADE
|
---|
29 | ON UPDATE CASCADE
|
---|
30 | );
|
---|
Note:
See
TracBrowser
for help on using the repository browser.