Merge pull request #21 from shyim/master

Added Primarykey and AI to id field
This commit is contained in:
Felix 2016-08-16 23:09:35 +02:00 committed by GitHub
commit 30e542e930

View File

@ -63,8 +63,8 @@ export function createTable(name) {
this.print(`Creating table ${CFG.SERVER_MYSQL_TABLE}`, 36);
return new Promise((resolve) => {
let query = `
CREATE TABLE IF NOT EXISTS ${name} (
id int(11) NOT NULL,
CREATE TABLE ${name} (
id int(11) NOT NULL AUTO_INCREMENT,
username longtext NOT NULL,
email longtext NOT NULL,
exp int(255) NOT NULL,
@ -77,15 +77,16 @@ export function createTable(name) {
send_marketing_emails tinyint(1) NOT NULL,
send_push_notifications tinyint(1) NOT NULL,
skin int(11) NOT NULL,
hair int(11) NOT NULL,
hai int(11) NOT NULL,
shirt int(11) NOT NULL,
pants int(11) NOT NULL,
hat int(11) NOT NULL,
shoes int(11) NOT NULL,
eyes int(11) NOT NULL,
gender int(11) NOT NULL,
backpack int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
backpack int(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
`;
this.db.instance.query(query, (e, rows, fields) => {
if (e) console.log(e);