26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
from flask_login import UserMixin
|
|
from app import db
|
|
|
|
class User(UserMixin, db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
username = db.Column(db.String(150), unique=True, nullable=False)
|
|
full_name = db.Column(db.String(300), nullable=False)
|
|
email = db.Column(db.String(150), unique=True, nullable=False)
|
|
phone_number = db.Column(db.String(50), nullable=True)
|
|
password = db.Column(db.String(50))
|
|
|
|
|
|
class SARCall(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
start_date = db.Column(db.DateTime, nullable=False)
|
|
finish_date = db.Column(db.DateTime, nullable=False)
|
|
category = db.Column(db.String(150), nullable=False)
|
|
latitude = db.Column(db.Float, nullable=False)
|
|
longitude = db.Column(db.Float, nullable=False)
|
|
search_manager_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
|
|
gpx_data = db.Column(db.Text, nullable=True) # This will store GPX data as a text
|
|
|
|
|
|
class SARCategory(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
name = db.Column(db.String(150), unique=True, nullable=False) |