This commit is contained in:
Samuel Mehrbrodt 2014-04-21 12:06:17 +02:00
parent 70a5795cd2
commit cc0af8845e
2 changed files with 5 additions and 4 deletions

View File

@ -112,7 +112,8 @@ def upgrade_4(session, metadata):
op.create_table('authors_songs_tmp',
Column('author_id', types.Integer(), ForeignKey('authors.id'), primary_key=True),
Column('song_id', types.Integer(), ForeignKey('songs.id'), primary_key=True),
Column('author_type', types.String(), primary_key=True, nullable=False, server_default=text('""')))
Column('author_type', types.String(), primary_key=True,
nullable=False, server_default=text('""')))
op.execute('INSERT INTO authors_songs_tmp SELECT author_id, song_id, "" FROM authors_songs')
op.drop_table('authors_songs')
op.rename_table('authors_songs_tmp', 'authors_songs')