Exemplo n.º 1
0
 def test_rename_column_serv_compiled_default(self):
     context = op_fixture('mysql')
     op.alter_column('t1', 'c1', new_column_name="c2", existing_type=Integer,
             existing_server_default=func.utc_thing(func.current_timestamp()))
     # this is not a valid MySQL default but the point is to just
     # test SQL expression rendering
     context.assert_(
         "ALTER TABLE t1 CHANGE c1 c2 INTEGER NULL DEFAULT utc_thing(CURRENT_TIMESTAMP)"
     )
Exemplo n.º 2
0
def test_rename_column_serv_compiled_default():
    context = op_fixture('mysql')
    op.alter_column('t1', 'c1', name="c2", existing_type=Integer,
            existing_server_default=func.utc_thing(func.current_timestamp()))
    # this is not a valid MySQL default but the point is to just
    # test SQL expression rendering
    context.assert_(
        "ALTER TABLE t1 CHANGE c1 c2 INTEGER NULL DEFAULT utc_thing(CURRENT_TIMESTAMP)"
    )
Exemplo n.º 3
0
 def test_rename_column_serv_compiled_default(self):
     context = op_fixture("mysql")
     op.alter_column(
         "t1",
         "c1",
         existing_type=Integer,
         server_default=func.utc_thing(func.current_timestamp()),
     )
     # this is not a valid MySQL default but the point is to just
     # test SQL expression rendering
     context.assert_("ALTER TABLE t1 ALTER COLUMN c1 "
                     "SET DEFAULT utc_thing(CURRENT_TIMESTAMP)")
Exemplo n.º 4
0
 def test_rename_column_serv_compiled_default(self):
     context = op_fixture("mysql")
     op.alter_column(
         "t1",
         "c1",
         existing_type=Integer,
         server_default=func.utc_thing(func.current_timestamp()),
     )
     # this is not a valid MySQL default but the point is to just
     # test SQL expression rendering
     context.assert_(
         "ALTER TABLE t1 ALTER COLUMN c1 "
         "SET DEFAULT utc_thing(CURRENT_TIMESTAMP)"
     )