User-Panel gebaut
This commit is contained in:
24
Dashboard/database.py
Normal file
24
Dashboard/database.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import sqlite3
|
||||
import bcrypt
|
||||
|
||||
DATABASE = "clickcandit.db"
|
||||
|
||||
def init_db():
|
||||
conn = sqlite3.connect(DATABASE)
|
||||
c = conn.cursor()
|
||||
c.execute("""
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
email TEXT UNIQUE NOT NULL,
|
||||
password TEXT NOT NULL,
|
||||
role TEXT DEFAULT 'user',
|
||||
reset_token TEXT DEFAULT NULL
|
||||
)
|
||||
""")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_db()
|
||||
print("Datenbank initialisiert!")
|
||||
Reference in New Issue
Block a user