1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-12-28 07:18:59 +00:00

make user_id an AI int to allow for signing up with an email previously used by someone else

This commit is contained in:
Lynne Megido 2019-09-01 19:53:38 +10:00
parent 20b0c46046
commit cae7cfe8c2
2 changed files with 5 additions and 5 deletions

View file

@ -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,

View file

@ -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()