修改外键
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
@@ -10,12 +10,12 @@ class Employments(Base): #学生就
|
||||
id = Column(Integer #主键,自增主键
|
||||
, primary_key=True
|
||||
, autoincrement=True
|
||||
# , ForeignKey='student.id'
|
||||
# , ForeignKey('student.id')
|
||||
, comment='自增主键'
|
||||
)
|
||||
|
||||
num = Column(Integer
|
||||
, ForeignKey('students.num')
|
||||
stuid = Column(Integer
|
||||
, ForeignKey('students.id')
|
||||
) #学生姓名,冗余字段
|
||||
class_num = Column(Integer
|
||||
, ForeignKey('classes.id')
|
||||
|
||||
Reference in New Issue
Block a user