Add index to migration file

changes/06/396006/1
Masayuki Igawa 7 years ago
parent ec29a3d956
commit 36ceae8ef8
  1. 2
      coverage2sql/db/models.py
  2. 1
      coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py

@ -54,5 +54,5 @@ class Coverage(BASE, CoverageBase):
project_name = sa.Column(sa.String(256),
nullable=False)
coverage_rate = sa.Column(sa.Float())
report_time = sa.Column(sa.DateTime(), default=datetime.datetime.now())
report_time = sa.Column(sa.DateTime(), default=datetime.datetime.utcnow())
report_time_microsecond = sa.Column(sa.Integer(), default=0)

@ -25,6 +25,7 @@ def upgrade():
sa.Column('report_time_microsecond', sa.Integer(),
default=0),
mysql_engine='InnoDB')
op.create_index('ix_project_name', 'coverages', ['project_name'])
def downgrade():

Loading…
Cancel
Save