外键
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from scores.database import Base
|
||||
from datetime import datetime
|
||||
from sqlalchemy import DateTime,Column,Integer,String,Float,ForeignKey
|
||||
|
||||
|
||||
|
||||
class Score(Base):
|
||||
__tablename__='scores'
|
||||
id = Column(Integer
|
||||
@@ -20,8 +23,8 @@ class Score(Base):
|
||||
,comment ='考试序次'
|
||||
)
|
||||
score = Column(Integer,nullable = False)
|
||||
tsub = Column(String(100)
|
||||
, ForeignKey('subject.id')
|
||||
t_subject = Column(Integer
|
||||
,ForeignKey('subject.id')
|
||||
,nullable = False
|
||||
)
|
||||
create_date = Column(DateTime
|
||||
|
||||
Reference in New Issue
Block a user