更新外键
This commit is contained in:
+7
-7
@@ -19,12 +19,14 @@ class Employments(Base_all): #学生
|
||||
class_id = Column(Integer
|
||||
, ForeignKey('classes.id')
|
||||
) #学生班级,冗余字段
|
||||
company_id = Column(Integer #公司id,外键匹配公司表
|
||||
company_id = Column(Integer # 公司id,外键匹配公司表
|
||||
, ForeignKey('Company.id')
|
||||
, nullable=True
|
||||
|
||||
)
|
||||
|
||||
address_id = Column(Integer # 地址id,匹配地址表
|
||||
, ForeignKey('Address.id') # 外键地址表id
|
||||
, nullable=False # 非空约束
|
||||
)
|
||||
employment_salary = Column(Integer, nullable=True) #薪资
|
||||
|
||||
employment_open_time = Column(DATE, nullable=True) #就业开放时间
|
||||
@@ -49,10 +51,7 @@ class Company(Base_all): #公司
|
||||
employment_company = Column(String(50) #公司姓名
|
||||
, nullable=False #非空约束
|
||||
)
|
||||
address_id = Column(Integer #地址id,匹配地址表
|
||||
, ForeignKey('Address.id') #外键地址表id
|
||||
, nullable=False #非空约束
|
||||
)
|
||||
|
||||
create_time = Column(DATETIME
|
||||
, default=datetime.now
|
||||
)
|
||||
@@ -71,6 +70,7 @@ class Address(Base_all):
|
||||
somewhere=Column(String(50) #地址区域
|
||||
, nullable=False
|
||||
)
|
||||
|
||||
create_time = Column(DATETIME
|
||||
, default=datetime.now
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user