Viewing profiles works, profiles not yet created

This commit is contained in:
2019-05-10 13:11:07 +10:00
parent 84ce324365
commit 31a59f56ba
8 changed files with 300 additions and 8 deletions
+17
View File
@@ -1,3 +1,4 @@
# account system
CREATE TABLE IF NOT EXISTS signups (
email VARCHAR(320) UNIQUE,
username VARCHAR(100) UNIQUE,
@@ -34,5 +35,21 @@ CREATE TABLE IF NOT EXISTS passwordRecover (
accountId INTEGER UNSIGNED UNIQUE,
token INTEGER DEFAULT 0,
CONSTRAINT FOREIGN KEY fk_accountId(accountId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE
);
#profile system
CREATE TABLE IF NOT EXISTS profiles (
id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE,
td TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
accountId INTEGER UNSIGNED UNIQUE,
gold INTEGER DEFAULT 0,
recruits INTEGER DEFAULT 0,
soldiers INTEGER DEFAULT 0,
spies INTEGER DEFAULT 0,
scientists INTEGER DEFAULT 0,
CONSTRAINT FOREIGN KEY fk_accountId(accountId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE
);
+2 -1
View File
@@ -1,4 +1,5 @@
DROP TABLE signups;
DROP TABLE accounts;
DROP TABLE sessions;
#DROP TABLE profiles;
DROP TABLE passwordRecover;
DROP TABLE profiles;