17 lines
855 B
Python
17 lines
855 B
Python
# Import necessary modules
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
# Create an instance of SQLAlchemy and assign it to db
|
|
db = SQLAlchemy()
|
|
|
|
# Define a User model class that inherits from db.Model
|
|
class table_user(db.Model):
|
|
# Define the id column as an integer primary key
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
# Define the user_name column as a string with max length 80 and must be unique and not nullable
|
|
user_name = db.Column(db.String(80), unique=True, nullable=False)
|
|
# Define the user_password column as a string with max length 120 and must be unique and not nullable
|
|
user_password = db.Column(db.String(120), unique=True, nullable=False)
|
|
# Define the user_email column as a string with max length 120 and must be unique and not nullable
|
|
user_email = db.Column(db.String(120), unique=True, nullable=False)
|