Skip to content

Commit

Permalink
* **Update:** Added the necessary alembic revision to reflect the cha…
Browse files Browse the repository at this point in the history
…nges in the ``Version_Inputs`` table.
  • Loading branch information
eoyilmaz committed Nov 29, 2016
1 parent b68b5a0 commit 2ecbbda
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -6,6 +6,8 @@ Stalker Changes
========

* **New:** Added ``Shot.fps`` attribute to hold the fps information per shot.
* **Update:** Added the necessary alembic revision to reflect the changes in
the ``Version_Inputs`` table.

0.2.17.2
========
Expand Down
23 changes: 23 additions & 0 deletions alembic/versions/0063f547dc2e_updated_version_inputs_table.py
@@ -0,0 +1,23 @@
"""updated version_inputs table
Revision ID: 0063f547dc2e
Revises: a9319b19f7be
Create Date: 2016-11-29 14:08:41.335000
"""

# revision identifiers, used by Alembic.
revision = '0063f547dc2e'
down_revision = 'a9319b19f7be'

from alembic import op


def upgrade():
op.drop_constraint(u'Version_Inputs_link_id_fkey', 'Version_Inputs', type_='foreignkey')
op.create_foreign_key(None, 'Version_Inputs', 'Links', ['link_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')


def downgrade():
op.drop_constraint(None, 'Version_Inputs', type_='foreignkey')
op.create_foreign_key(u'Version_Inputs_link_id_fkey', 'Version_Inputs', 'Links', ['link_id'], ['id'])
2 changes: 1 addition & 1 deletion stalker/db/__init__.py
Expand Up @@ -36,7 +36,7 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging_level)

alembic_version = 'a9319b19f7be'
alembic_version = '0063f547dc2e'


def setup(settings=None):
Expand Down
4 changes: 2 additions & 2 deletions tests/db/test_db.py
Expand Up @@ -1022,7 +1022,7 @@ def test_initialization_of_alembic_version_table(self):
sql_query = 'select version_num from "alembic_version"'
version_num = \
db.DBSession.connection().execute(sql_query).fetchone()[0]
self.assertEqual('a9319b19f7be', version_num)
self.assertEqual('0063f547dc2e', version_num)

def test_initialization_of_alembic_version_table_multiple_times(self):
"""testing if the db.create_alembic_table() will handle initializing
Expand All @@ -1042,7 +1042,7 @@ def test_initialization_of_alembic_version_table_multiple_times(self):
sql_query = 'select version_num from "alembic_version"'
version_num = \
db.DBSession.connection().execute(sql_query).fetchone()[0]
self.assertEqual('a9319b19f7be', version_num)
self.assertEqual('0063f547dc2e', version_num)

db.DBSession.remove()
db.setup(db_config)
Expand Down

0 comments on commit 2ecbbda

Please sign in to comment.