Add test_type column

This commit is contained in:
Masayuki Igawa 2016-10-19 18:09:02 +09:00
parent 36ceae8ef8
commit 33a6c63ac3
3 changed files with 29 additions and 1 deletions

View File

@ -54,5 +54,6 @@ class Coverage(BASE, CoverageBase):
project_name = sa.Column(sa.String(256), project_name = sa.Column(sa.String(256),
nullable=False) nullable=False)
coverage_rate = sa.Column(sa.Float()) 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 = sa.Column(sa.DateTime(), default=datetime.datetime.utcnow())
report_time_microsecond = sa.Column(sa.Integer(), default=0) report_time_microsecond = sa.Column(sa.Integer(), default=0)

View File

@ -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')

View File

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