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
|
||||
|
8
db.py
8
db.py
@ -28,6 +28,14 @@ def check_tables():
|
||||
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