forked from openlp/openlp
Removed 'populate_default' arguments as they are not supported in older versions of migrate.
Fixes: https://launchpad.net/bugs/896977
This commit is contained in:
parent
2b0fc0f2ad
commit
87f5d7843c
@ -68,9 +68,9 @@ def upgrade_1(session, metadata, tables):
|
|||||||
"""
|
"""
|
||||||
Table(u'media_files_songs', metadata, autoload=True).drop(checkfirst=True)
|
Table(u'media_files_songs', metadata, autoload=True).drop(checkfirst=True)
|
||||||
Column(u'song_id', types.Integer(), default=None)\
|
Column(u'song_id', types.Integer(), default=None)\
|
||||||
.create(table=tables[u'media_files'], populate_default=True)
|
.create(table=tables[u'media_files'])
|
||||||
Column(u'weight', types.Integer(), default=0)\
|
Column(u'weight', types.Integer(), default=0)\
|
||||||
.create(table=tables[u'media_files'], populate_default=True)
|
.create(table=tables[u'media_files'])
|
||||||
if metadata.bind.url.get_dialect().name != 'sqlite':
|
if metadata.bind.url.get_dialect().name != 'sqlite':
|
||||||
# SQLite doesn't support ALTER TABLE ADD CONSTRAINT
|
# SQLite doesn't support ALTER TABLE ADD CONSTRAINT
|
||||||
ForeignKeyConstraint([u'song_id'], [u'songs.id'],
|
ForeignKeyConstraint([u'song_id'], [u'songs.id'],
|
||||||
@ -83,6 +83,7 @@ def upgrade_2(session, metadata, tables):
|
|||||||
This upgrade adds a create_date and last_modified date to the songs table
|
This upgrade adds a create_date and last_modified date to the songs table
|
||||||
"""
|
"""
|
||||||
Column(u'create_date', types.DateTime(), default=func.now())\
|
Column(u'create_date', types.DateTime(), default=func.now())\
|
||||||
.create(table=tables[u'songs'], populate_default=True)
|
.create(table=tables[u'songs'])
|
||||||
Column(u'last_modified', types.DateTime(), default=func.now())\
|
Column(u'last_modified', types.DateTime(), default=func.now())\
|
||||||
.create(table=tables[u'songs'], populate_default=True)
|
.create(table=tables[u'songs'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user