Did I find the right examples for you? yes no

All Samples(71)  |  Call(71)  |  Derive(0)  |  Import(0)
Emit an ALTER TABLE to rename a table.

:param old_table_name: old name.
:param new_table_name: new name.
:param schema: Optional schema name to operate within.

src/f/l/floof-HEAD/alembic/versions/20120908_310d62d88dc3_rename_labels_to_alb.py   floof(Download)
def upgrade():
    op.rename_table('artwork_labels', 'artwork_albums')
    op.alter_column('artwork_albums', 'label_id', name='album_id')
 
    op.rename_table('labels', 'albums')
def downgrade():
    op.execute('ALTER TYPE albums_encapsulation RENAME TO labels_encapsulation')
 
    op.rename_table('albums', 'labels')
 
    op.alter_column('artwork_labels', 'album_id', name='label_id')
    op.rename_table('artwork_albums', 'artwork_labels')

src/s/t/stalker-0.2.7.2/alembic/versions/25b3eba6ffe7_derive_version_from_.py   stalker(Download)
        op.drop_table('Versions')
        # and rename the new table to the old one
        op.rename_table('Versions_New', 'Versions')
 
def downgrade():

src/s/k/skylines-HEAD/migrations/versions/2c560c33fab9_removed_tg__prefixes.py   skylines(Download)
def upgrade():
    op.rename_table('tg_user', 'users')
    op.rename_table('tg_group', 'groups')
    op.rename_table('tg_permission', 'permissions')
    op.rename_table('tg_group_permission', 'group_permissions')
    op.rename_table('tg_user_group', 'user_groups')

src/i/n/inbox-HEAD/migrations/versions/028_tag_api_migration.py   inbox(Download)
            session.close()
 
    op.rename_table('internaltag', 'usertag')
    op.create_table(
        'usertagitem',

src/h/o/holmes-0.10.15/holmes/migrations/versions/17346cf564bc_renaming_delimiters_table_to_limiters.py   holmes(Download)
def upgrade():
    op.rename_table('delimiters', 'limiters')
 
 
def downgrade():
    op.rename_table('limiters', 'delimiters')

src/t/a/taskflow-0.2/taskflow/persistence/backends/sqlalchemy/alembic/versions/589dccdf2b6e_rename_taskdetails_to_atomdetails.py   taskflow(Download)
def upgrade():
    op.rename_table("taskdetails", "atomdetails")
 
 
def downgrade():
    op.rename_table("atomdetails", "taskdetails")

src/h/o/holmes-api-HEAD/holmes/migrations/versions/17346cf564bc_renaming_delimiters_table_to_limiters.py   holmes-api(Download)
def upgrade():
    op.rename_table('delimiters', 'limiters')
 
 
def downgrade():
    op.rename_table('limiters', 'delimiters')

src/a/l/alembic-0.6.4/tests/test_op.py   alembic(Download)
def test_rename_table():
    context = op_fixture()
    op.rename_table('t1', 't2')
    context.assert_("ALTER TABLE t1 RENAME TO t2")
 
def test_rename_table_schema():
    context = op_fixture()
    op.rename_table('t1', 't2', schema="foo")
def test_rename_table_postgresql():
    context = op_fixture("postgresql")
    op.rename_table('t1', 't2')
    context.assert_("ALTER TABLE t1 RENAME TO t2")
 
def test_rename_table_schema_postgresql():
    context = op_fixture("postgresql")
    op.rename_table('t1', 't2', schema="foo")

src/a/l/alembic-HEAD/tests/test_op.py   alembic(Download)
def test_rename_table():
    context = op_fixture()
    op.rename_table('t1', 't2')
    context.assert_("ALTER TABLE t1 RENAME TO t2")
 
def test_rename_table_schema():
    context = op_fixture()
    op.rename_table('t1', 't2', schema="foo")
def test_rename_table_postgresql():
    context = op_fixture("postgresql")
    op.rename_table('t1', 't2')
    context.assert_("ALTER TABLE t1 RENAME TO t2")
 
def test_rename_table_schema_postgresql():
    context = op_fixture("postgresql")
    op.rename_table('t1', 't2', schema="foo")

Previous  1 | 2