diff --git a/setup.sql b/setup.sql index 740c81e..ee66665 100644 --- a/setup.sql +++ b/setup.sql @@ -1,11 +1,11 @@ USE `fedibooks`; CREATE TABLE IF NOT EXISTS `users` ( - `id` BINARY(64) PRIMARY KEY, + `id` INT AUTO_INCREMENT PRIMARY KEY, `email` VARCHAR(128) UNIQUE NOT NULL, `password` BINARY(60) NOT NULL ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `contact_settings` ( - `user_id` BINARY(64) NOT NULL, + `user_id` INT NOT NULL, `fetch` ENUM('always', 'once', 'never') DEFAULT 'once', `submit` ENUM('always', 'once', 'never') DEFAULT 'once', `generation` ENUM('always', 'once', 'never') DEFAULT 'once', @@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `credentials` ( ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `bots` ( `id` BINARY(64) PRIMARY KEY, - `user_id` BINARY(64) NOT NULL, + `user_id` INT NOT NULL, `credentials_id` INT NOT NULL, `enabled` BOOLEAN DEFAULT 1, `replies_enabled` BOOLEAN DEFAULT 1, @@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `word_blacklist` ( FOREIGN KEY (`bot_id`) REFERENCES bots(id) ON DELETE CASCADE ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `contact_history` ( - `user_id` BINARY(64) NOT NULL, + `user_id` INT NOT NULL, `fetch` BOOLEAN DEFAULT 0, `submit` BOOLEAN DEFAULT 0, `generation` BOOLEAN DEFAULT 0, diff --git a/webui.py b/webui.py index e0fedf9..17c4ebc 100644 --- a/webui.py +++ b/webui.py @@ -82,7 +82,7 @@ def do_signup(): # try to sign up c = mysql.connection.cursor() - c.execute("INSERT INTO `users` (id, email, password) VALUES (%s, %s, %s)", (user_id, request.form['email'], pw)) + c.execute("INSERT INTO `users` (email, password) VALUES (%s, %s)", (request.form['email'], pw)) mysql.connection.commit() c.close()