将数据操作全部改为迁移脚本
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from .admin_dept import Dept, DeptSchema
|
||||
from .admin_dict import DictType, DictData, DictTypeSchema, DictDataSchema
|
||||
from .admin_log import AdminLog, LogSchema
|
||||
from .admin_photo import Photo, PhotoSchema
|
||||
from .admin_power import Power, PowerSchema, PowerSchema2
|
||||
from .admin_role import Role, RoleSchema
|
||||
from .admin_role_power import role_power
|
||||
from .admin_user import User, UserSchema
|
||||
from .admin_user_role import user_role
|
||||
from .dept import Dept, DeptSchema
|
||||
from .dict_models import DictType, DictData, DictTypeSchema, DictDataSchema
|
||||
from .log import AdminLog, LogSchema
|
||||
from applications.models.file.photo import Photo, PhotoSchema
|
||||
from applications.models.rights.power import Power, PowerSchema, PowerSchema2
|
||||
from applications.models.rights.role import Role, RoleSchema
|
||||
from applications.models.rights.role_power import role_power
|
||||
from applications.models.users.employee import User, UserSchema
|
||||
from applications.models.rights.user_role import user_role
|
||||
|
||||
@@ -11,13 +11,15 @@ class Power(db.Model):
|
||||
code = db.Column(db.String(30), comment='权限标识')
|
||||
url = db.Column(db.String(255), comment='权限路径')
|
||||
open_type = db.Column(db.String(10), comment='打开方式')
|
||||
parent_id = db.Column(db.Integer, comment='父类编号')
|
||||
parent_id = db.Column(db.Integer, db.ForeignKey("admin_power.id"), comment='父类编号')
|
||||
icon = db.Column(db.String(128), comment='图标')
|
||||
sort = db.Column(db.Integer, comment='排序')
|
||||
create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
|
||||
update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
|
||||
enable = db.Column(db.Integer, comment='是否开启')
|
||||
|
||||
parent = db.relationship("Power", remote_side=[id]) # 自关联
|
||||
|
||||
|
||||
# 权限models序列化类
|
||||
class PowerSchema(ma.Schema):
|
||||
Reference in New Issue
Block a user