Add a migration to move the existing webhooks over and another migration to remove the legacy webhooks table.
This commit is contained in:
parent
53a1f62614
commit
3f6466fccd
2 changed files with 57 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
||||||
|
"""Remove the legacy webhooks table
|
||||||
|
|
||||||
|
Revision ID: 2d9b90e50775
|
||||||
|
Revises: 47670cbeced
|
||||||
|
Create Date: 2014-07-31 13:56:10.702609
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '2d9b90e50775'
|
||||||
|
down_revision = '47670cbeced'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.dialects import mysql
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('webhook')
|
||||||
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('webhook',
|
||||||
|
sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
|
||||||
|
sa.Column('public_id', mysql.VARCHAR(length=255), nullable=False),
|
||||||
|
sa.Column('repository_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
|
||||||
|
sa.Column('parameters', mysql.LONGTEXT(), nullable=False),
|
||||||
|
sa.ForeignKeyConstraint(['repository_id'], [u'repository.id'], name=u'fk_webhook_repository_repository_id'),
|
||||||
|
sa.PrimaryKeyConstraint('id'),
|
||||||
|
mysql_default_charset=u'latin1',
|
||||||
|
mysql_engine=u'InnoDB'
|
||||||
|
)
|
||||||
|
### end Alembic commands ###
|
|
@ -0,0 +1,22 @@
|
||||||
|
"""Migrate existing webhooks to notifications.
|
||||||
|
|
||||||
|
Revision ID: 47670cbeced
|
||||||
|
Revises: 325a4d7c79d9
|
||||||
|
Create Date: 2014-07-31 13:49:38.332807
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '47670cbeced'
|
||||||
|
down_revision = '325a4d7c79d9'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
pass
|
Reference in a new issue