#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @File     : user
# @Author   : LiuYan
# @Time     : 2021/12/1 10:15

from base.dao.base_dao import db, BaseDao


class User(db.Model):
    __tablename__ = '_user'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(50), nullable=False)
    age = db.Column(db.Integer, nullable=True)
    role_id = db.Column(db.Integer, db.ForeignKey('_role.id'), nullable=False)
    role = db.relationship('Role', backref='Users')
