# Database Models
from . import db # that SQLAlchemy Object in __init__.py
from flask_login import UserMixin
from sqlalchemy.sql import func

class User(db.Model, UserMixin): # User Database
   id = db.Column(db.Integer, primary_key=True)
   email = db.Column(db.String(150), unique=True)
   password = db.Column(db.String(150))
   username = db.Column(db.String(150))
   profile_image = db.Column(db.String(150))


class Bookmark(db.Model, UserMixin):
   id = db.Column(db.Integer, primary_key=True)
   owner = db.Column(db.Integer) # owner id
   status = db.Column(db.String(8)) # public/private
   name = db.Column(db.String(150))
   group = db.Column(db.String(150))
   link = db.Column(db.String(150))
   icon = db.Column(db.String(150))


class Groups(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key=True)
    owner = db.Column(db.Integer) # owner id
    group = db.Column(db.String(150), unique=True)
