# Path: database.py
# def get_session():
# def teardown_session(exception):


from database import TableBase, Column, Integer, String, session, Text, MEDIUMTEXT
from flask_login import UserMixin
import hashlib
import random
import string
import os


def random_string(N):
    return ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for i in range(N))


class User(TableBase, UserMixin):
    """A user."""

    __tablename__ = 'user'
    id = Column(Integer, primary_key=True)
    email = Column(String(63), unique=True)
    passwordhash = Column(String(127), nullable=False)
    salt = Column(String(127), nullable=False)
    username = Column(String(127))
    if os.getenv('FLASK_TESTING'):
        avatar = Column(String(16777215))
    else:
        avatar = Column(MEDIUMTEXT())
    description = Column(Text())
    education = Column(Text())

# Path: database.py
# def get_session():
# def teardown_session(exception):


# Path: models/user.py
from database import TableBase, Column, Integer, String, session, Text, MEDIUMTEXT
from flask_login import UserMixin
import hashlib
import random
import string
import os



def random_string(N):
    return ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for i in range(N))


class User(TableBase, UserMixin):
    """A user."""

    __tablename__ = 'user'
    id = Column(Integer, primary_key=True)
    email = Column(String(63), unique=True)
    passwordhash = Column(String(127), nullable=False)
    salt = Column(String(127), nullable=False)
    username = Column(String(127))
    if os.getenv('FLASK_TESTING'):
        avatar = Column(String(16777215))
    else:
        avatar = Column(MEDIUMTEXT())
    description = Column(Text())
    education = Column(Text())

    major = Column(Text())