修改外键
This commit is contained in:
+6
-12
@@ -1,5 +1,5 @@
|
||||
from sqlalchemy import ForeignKey
|
||||
|
||||
from student_manage_system import students,classes
|
||||
from stu_jiuye.database import DATETIME,Base,Column,Integer,String,DATE
|
||||
from datetime import datetime
|
||||
|
||||
@@ -13,25 +13,19 @@ class Employments(Base): #学生就
|
||||
# , ForeignKey='student.id'
|
||||
, comment='自增主键'
|
||||
)
|
||||
sname = Column(String(50)
|
||||
# , ForeignKey='student.name'
|
||||
|
||||
num = Column(Integer
|
||||
, ForeignKey('students.num')
|
||||
) #学生姓名,冗余字段
|
||||
class_num = Column(Integer
|
||||
# , ForeignKey='class.id'
|
||||
, ForeignKey('classes.id')
|
||||
) #学生班级,冗余字段
|
||||
|
||||
# compname=Column(String(50)
|
||||
# ,nullable=False
|
||||
# )
|
||||
company_id = Column(Integer #公司id,外键匹配公司表
|
||||
, ForeignKey('Company.id')
|
||||
, nullable=True
|
||||
|
||||
)
|
||||
# address_id = Column(Integer
|
||||
# , ForeignKey('Address.id')
|
||||
# , nullable=False
|
||||
# )
|
||||
|
||||
employment_salary = Column(Integer, nullable=True) #薪资
|
||||
|
||||
employment_open_time = Column(DATE, nullable=True) #就业开放时间
|
||||
|
||||
Reference in New Issue
Block a user