updated sql for more info
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def init_db():
|
|
30 |
firstName TEXT NOT NULL,
|
31 |
lastName TEXT NOT NULL,
|
32 |
country TEXT,
|
33 |
-
|
34 |
email TEXT UNIQUE NOT NULL, -- Email should be unique and non-null
|
35 |
password TEXT NOT NULL -- Password will be stored as a string (hashed ideally)
|
36 |
)
|
@@ -44,7 +44,7 @@ class UserSignup(BaseModel):
|
|
44 |
firstName: str
|
45 |
lastName: str
|
46 |
country: str
|
47 |
-
|
48 |
email: EmailStr
|
49 |
password: str
|
50 |
|
@@ -66,7 +66,7 @@ async def signup(user_data: UserSignup):
|
|
66 |
# Insert new user
|
67 |
c.execute("""
|
68 |
INSERT INTO users (firstName, lastName, country, number, email, password)
|
69 |
-
VALUES (?, ?, ?, ?)
|
70 |
""", (user_data.firstName, user_data.lastName, user_data.country, user_data.number, user_data.email, user_data.password))
|
71 |
|
72 |
conn.commit()
|
|
|
30 |
firstName TEXT NOT NULL,
|
31 |
lastName TEXT NOT NULL,
|
32 |
country TEXT,
|
33 |
+
number TEXT, -- Phone number stored as TEXT to allow various formats
|
34 |
email TEXT UNIQUE NOT NULL, -- Email should be unique and non-null
|
35 |
password TEXT NOT NULL -- Password will be stored as a string (hashed ideally)
|
36 |
)
|
|
|
44 |
firstName: str
|
45 |
lastName: str
|
46 |
country: str
|
47 |
+
number: str
|
48 |
email: EmailStr
|
49 |
password: str
|
50 |
|
|
|
66 |
# Insert new user
|
67 |
c.execute("""
|
68 |
INSERT INTO users (firstName, lastName, country, number, email, password)
|
69 |
+
VALUES (?, ?, ?, ?, ?, ?)
|
70 |
""", (user_data.firstName, user_data.lastName, user_data.country, user_data.number, user_data.email, user_data.password))
|
71 |
|
72 |
conn.commit()
|