if nullable is not None:
existing.nullable = nullable
if server_default is not False:
- existing.server_default = server_default
+ sql_schema.DefaultClause(server_default)._set_parent(existing)
if autoincrement is not None:
existing.autoincrement = bool(autoincrement)
new_table = self._assert_impl(impl, colnames=['id', 'x', 'y', 'g'])
eq_(new_table.c.g.name, 'g')
+ def test_add_server_default(self):
+ impl = self._simple_fixture()
+ impl.alter_column('tname', 'y', server_default="10")
+ new_table = self._assert_impl(
+ impl, ddl_contains="DEFAULT '10'")
+ eq_(
+ new_table.c.y.server_default.arg, "10"
+ )
+
def test_rename_col_pk(self):
impl = self._simple_fixture()
impl.alter_column('tname', 'id', name='foobar')