修改外键
This commit is contained in:
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
from sqlalchemy import ForeignKey
|
from sqlalchemy import ForeignKey
|
||||||
from student_manage_system import students,classes
|
|
||||||
from stu_jiuye.database import DATETIME,Base,Column,Integer,String,DATE
|
from stu_jiuye.database import DATETIME,Base,Column,Integer,String,DATE
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@@ -10,12 +10,12 @@ class Employments(Base): #学生就
|
|||||||
id = Column(Integer #主键,自增主键
|
id = Column(Integer #主键,自增主键
|
||||||
, primary_key=True
|
, primary_key=True
|
||||||
, autoincrement=True
|
, autoincrement=True
|
||||||
# , ForeignKey='student.id'
|
# , ForeignKey('student.id')
|
||||||
, comment='自增主键'
|
, comment='自增主键'
|
||||||
)
|
)
|
||||||
|
|
||||||
num = Column(Integer
|
stuid = Column(Integer
|
||||||
, ForeignKey('students.num')
|
, ForeignKey('students.id')
|
||||||
) #学生姓名,冗余字段
|
) #学生姓名,冗余字段
|
||||||
class_num = Column(Integer
|
class_num = Column(Integer
|
||||||
, ForeignKey('classes.id')
|
, ForeignKey('classes.id')
|
||||||
|
|||||||
Reference in New Issue
Block a user