sub rename_table {
my ($old, $new) = @_;;
- q(sp_rename ') . $old->name . q(', ') . $new->name . q(')
+ q(EXEC sp_rename ') . $old->name . q(', ') . $new->name . q(')
}
sub alter_drop_constraint {
}
sub rename_field {
- 'lol'
+ q(EXEC sp_rename ') . $_[0]->name . q(', ') . $_[1]->name . q(', 'COLUMN')
}
sub alter_create_index {
my $field_clause = build_field_clause($new_field);
my $table_name_q= $new_field->table->name;
- my @sql= "ALTER TABLE $table_name_q ADD COLUMN $field_clause;";
+ my @sql= "ALTER TABLE $table_name_q ADD $field_clause;";
if (lc($new_field->data_type) eq 'enum') {
push @sql, build_add_enum_constraint($new_field, $options).';';
}
push @sql, build_drop_enum_constraint($old_field, $options).';';
}
- push @sql, "ALTER TABLE $table_name_q DROP COLUMN $field_name_q;";
+ push @sql, "ALTER TABLE $table_name_q DROP $field_name_q;";
return join("\n", @sql);
}