diff --git a/data/database.py b/data/database.py index 39a142b5b..4f8d8b999 100644 --- a/data/database.py +++ b/data/database.py @@ -521,7 +521,7 @@ class RepositoryBuild(BaseModel): uuid = CharField(default=uuid_generator, index=True) repository = ForeignKeyField(Repository, index=True) access_token = ForeignKeyField(AccessToken) - resource_key = CharField(index=True) + resource_key = CharField(index=True, null=True) job_config = TextField() phase = CharField(default=BUILD_PHASE.WAITING) started = DateTimeField(default=datetime.now) diff --git a/data/migrations/versions/31288f79df53_make_resource_key_nullable.py b/data/migrations/versions/31288f79df53_make_resource_key_nullable.py new file mode 100644 index 000000000..e52795ce6 --- /dev/null +++ b/data/migrations/versions/31288f79df53_make_resource_key_nullable.py @@ -0,0 +1,30 @@ +"""make resource_key nullable + +Revision ID: 31288f79df53 +Revises: 214350b6a8b1 +Create Date: 2015-03-23 14:34:04.816295 + +""" + +# revision identifiers, used by Alembic. +revision = '31288f79df53' +down_revision = '214350b6a8b1' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +def upgrade(tables): + ### commands auto generated by Alembic - please adjust! ### + op.alter_column('repositorybuild', 'resource_key', + existing_type=mysql.VARCHAR(length=255), + nullable=True) + ### end Alembic commands ### + + +def downgrade(tables): + ### commands auto generated by Alembic - please adjust! ### + op.alter_column('repositorybuild', 'resource_key', + existing_type=mysql.VARCHAR(length=255), + nullable=False) + ### end Alembic commands ### diff --git a/test/data/test.db b/test/data/test.db index d673e2291..805e08f80 100644 Binary files a/test/data/test.db and b/test/data/test.db differ