feat: Add db table for sites
This commit is contained in:
parent
083796b035
commit
da417c4b63
@ -33,6 +33,10 @@ def generate_cookie():
|
||||
|
||||
# Create a new user
|
||||
def create_user(email, domain, password):
|
||||
if len(email) < 4 or len(domain) < 4 or len(password) < 4:
|
||||
return {'success': False, 'message': 'Invalid email, domain, or password'}
|
||||
|
||||
|
||||
# Hash password
|
||||
hashed_password = hash_password(password)
|
||||
# Create user
|
||||
|
10
db.py
10
db.py
@ -27,7 +27,15 @@ def check_tables():
|
||||
token VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
""")
|
||||
""")
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS site (
|
||||
id INT(11) NOT NULL AUTO_INCREMENT,
|
||||
domain VARCHAR(255) NOT NULL,
|
||||
data VARCHAR(2048) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
""")
|
||||
cursor.close()
|
||||
connection.close()
|
||||
print("Checked tables")
|
||||
|
Loading…
Reference in New Issue
Block a user