Add test_type column

changes/06/396006/1
Masayuki Igawa 6 years ago
parent 36ceae8ef8
commit 33a6c63ac3
  1. 1
      coverage2sql/db/models.py
  2. 27
      coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py
  3. 2
      coverage2sql/shell.py

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

@ -0,0 +1,27 @@
"""Add test_type column
Revision ID: cb0e61ce633e
Revises: 52dfb338f74e
Create Date: 2016-10-19 17:48:34.056367
"""
# revision identifiers, used by Alembic.
revision = 'cb0e61ce633e'
down_revision = '52dfb338f74e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('coverages', sa.Column('test_type', sa.String(256),
nullable=False, server_default='py27'))
op.create_index('ix_test_type', 'coverages', ['test_type'])
def downgrade():
op.drop_index('ix_test_type', 'coverages')
op.drop_column('coverages', 'test_type')

@ -29,7 +29,7 @@ CONF = cfg.CONF
CONF.import_opt('verbose', 'coverage2sql.db.api')
SHELL_OPTS = [
cfg.StrOpt('project_name', positional=False,
cfg.StrOpt('project_name', positional=True, required=True,
help='project name of the coverage files'),
cfg.StrOpt('coverage_file', positional=False,
help='A coverage file to put into the database'),

Loading…
Cancel
Save