Fix DB bugs found testing with mysql

No one should be using this yet so I fixed a bug by changing a
migration instead of doing the right thing.
This commit is contained in:
Matthew Treinish
2014-06-20 18:11:27 -04:00
parent 937a0774c7
commit 969dff7821
3 changed files with 3 additions and 4 deletions

View File

@@ -128,8 +128,8 @@ def create_test_run(test_id, run_id, status, start_time=None,
test_run = models.TestRun()
test_run.test_id = test_id
test_run.run_id = run_id
test_run.stop_time = end_time
test_run.start_time = start_time
test_run.stop_time = end_time.replace(tzinfo=None)
test_run.start_time = start_time.replace(tzinfo=None)
session = session or get_session()
with session.begin():
session.add(test_run)

View File

@@ -54,7 +54,7 @@ def upgrade():
sa.Column('key', sa.String(255)),
sa.Column('value', sa.String(255)),
sa.Column('test_run_id', sa.String(36),
sa.ForeignKey('test_runs.id'),
sa.ForeignKey('tests.id'),
nullable=False),
mysql_engine='InnoDB')

View File

@@ -47,7 +47,6 @@ _DEFAULT_SQL_CONNECTION = 'sqlite:///' + state_path_def('subunit2sql.sqlite')
def parse_args(argv, default_config_files=None):
options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION,
sqlite_db='subunit2sql.sqlite')
CONF.register_opts(options.database_opts)
cfg.CONF(argv[1:], project='subunit2sql',
default_config_files=default_config_files)