mirror of
https://github.com/GSA/notifications-api.git
synced 2026-06-04 21:38:20 -04:00
Update Template.version and TemplateHistory.version nullable=False to match the db
This commit is contained in:
@@ -278,7 +278,7 @@ class Template(db.Model):
|
||||
subject = db.Column(db.Text, index=False, unique=False, nullable=True)
|
||||
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), index=True, nullable=False)
|
||||
created_by = db.relationship('User')
|
||||
version = db.Column(db.Integer, default=1)
|
||||
version = db.Column(db.Integer, default=1, nullable=False)
|
||||
|
||||
|
||||
class TemplateHistory(db.Model):
|
||||
@@ -296,7 +296,7 @@ class TemplateHistory(db.Model):
|
||||
subject = db.Column(db.Text)
|
||||
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), index=True, nullable=False)
|
||||
created_by = db.relationship('User')
|
||||
version = db.Column(db.Integer, primary_key=True)
|
||||
version = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
|
||||
|
||||
MMG_PROVIDER = "mmg"
|
||||
|
||||
@@ -25,9 +25,6 @@ def upgrade():
|
||||
op.alter_column('services_history', 'research_mode',
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=False)
|
||||
op.alter_column('templates', 'version',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=True)
|
||||
op.create_foreign_key('templates_history_service_id_fkey', 'templates_history', 'services', ['service_id'], ['id'])
|
||||
op.create_foreign_key('templates_history_created_by_id_fkey', 'templates_history', 'users', ['created_by_id'], ['id'])
|
||||
### end Alembic commands ###
|
||||
@@ -37,9 +34,6 @@ def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('templates_history_service_id_fkey', 'templates_history', type_='foreignkey')
|
||||
op.drop_constraint('templates_history_created_by_id_fkey', 'templates_history', type_='foreignkey')
|
||||
op.alter_column('templates', 'version',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=False)
|
||||
op.alter_column('services_history', 'research_mode',
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user