+next
+- anonymous indexes (via Column(unique=True) etc) use column._label for naming
+to avoid collisions
0.1.7
- some fixes to topological sort algorithm
- added DISTINCT ON support to Postgres (just supply distinct=[col1,col2..])
raise ValueError("index and unique may not both be specified")
if index:
if index is True:
- name = 'ix_%s' % column.name
+ name = 'ix_%s' % column._label
else:
name = index
elif unique:
if unique is True:
- name = 'ux_%s' % column.name
+ name = 'ux_%s' % column._label
else:
name = unique
# find this index in self.indexes
Column('winner', String(30), index='idx_winners'))
index_names = [ ix.name for ix in events.indexes ]
- assert 'ux_name' in index_names
- assert 'ix_location' in index_names
+ assert 'ux_events_name' in index_names
+ assert 'ix_events_location' in index_names
assert 'sport_announcer' in index_names
assert 'idx_winners' in index_names
assert len(index_names) == 4
assert capt[0].strip().startswith('CREATE TABLE events')
assert capt[2].strip() == \
- 'CREATE UNIQUE INDEX ux_name ON events (name)'
+ 'CREATE UNIQUE INDEX ux_events_name ON events (name)'
assert capt[4].strip() == \
- 'CREATE INDEX ix_location ON events (location)'
+ 'CREATE INDEX ix_events_location ON events (location)'
assert capt[6].strip() == \
'CREATE UNIQUE INDEX sport_announcer ON events (sport, announcer)'
assert capt[8].strip() == \