Skip to content

Commit 047beda

Browse files
authored
Merge pull request #34 from CloverHealth/nullable-columns-funhouse
fix migrations for upgrading
2 parents 9c870f3 + 1cd85a1 commit 047beda

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ matrix:
3838
addons:
3939
postgresql: 9.5
4040
env: PG=9.5
41-
- python: 3.3
42-
addons:
43-
postgresql: 9.5
44-
env: PG=9.5
4541

4642
script: python setup.py test
4743

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import sys
44
import setuptools
55

6-
if sys.version_info < (3, 3):
7-
raise Exception('Python version < 3.3 are not supported.')
6+
if sys.version_info < (3, 4):
7+
raise Exception('Python version < 3.4 are not supported.')
88

99
# Get version information without importing the package
1010
__version__ = None

temporal_sqlalchemy/clock.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,15 @@ def build_clock_table(entity_table: sa.Table,
195195
primary_key=True),
196196
sa.Column('tick',
197197
sa.Integer,
198+
nullable=False,
198199
autoincrement=False),
199200
sa.Column('timestamp',
200201
sa.DateTime(True),
201202
server_default=sa.func.current_timestamp()),
202203
schema=schema)
203204

204205
entity_keys = set()
205-
for fk in util.foreign_key_to(entity_table):
206+
for fk in util.foreign_key_to(entity_table, nullable=False):
206207
# this is done to support arbitrary primary key shape on entity
207208
clock_table.append_column(fk)
208209
entity_keys.add(fk.key)
@@ -225,7 +226,7 @@ def build_clock_table(entity_table: sa.Table,
225226
activity_keys.add(fk.key)
226227
# ensure we have DB constraint on clock <> activity uniqueness
227228
clock_table.append_constraint(
228-
sa.UniqueConstraint(*(entity_keys | activity_keys))
229+
sa.UniqueConstraint(*(activity_keys | entity_keys))
229230
)
230231

231232
return clock_table

temporal_sqlalchemy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Version information."""
2-
__version__ = '0.4.0'
2+
__version__ = '0.4.1'

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pytest>=3.0.0
2-
pytest-cov>=2.4.0
2+
pytest-cov>=2.5.0
33
python-coveralls>=2.9.0
44
testing.postgresql>=1.3.0

0 commit comments

Comments
 (0)