Esempio n. 1
0
        public virtual string Translate(SqlCompilerContext context, SqlRenameColumn action)
        {
            var table      = action.Column.Table;
            var schema     = table.Schema;
            var columnName = QuoteIdentifier(schema.Catalog.DbName, schema.DbName, table.DbName, action.Column.DbName);

            return(TranslateExecSpRename(context, table, columnName, action.NewName, "COLUMN"));
        }
Esempio n. 2
0
        public virtual string Translate(SqlCompilerContext context, SqlRenameColumn action) //TODO: Work on this.
        {
            string schemaName = action.Column.Table.Schema.DbName;
            string tableName  = action.Column.Table.DbName;
            string columnName = action.Column.DbName;

            //alter table `actor` change column last_name1 last_name varchar(45)

            var builder = new StringBuilder();

            builder.Append("ALTER TABLE ");
            builder.Append(QuoteIdentifier(tableName));
            builder.Append(" CHANGE COLUMN ");
            builder.Append(QuoteIdentifier(columnName));
            builder.Append(" ");
            builder.Append(QuoteIdentifier(action.NewName));
            builder.Append(" ");
            builder.Append(Translate(action.Column.DataType));

            return(builder.ToString());
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public virtual string Translate(SqlCompilerContext context, SqlRenameColumn action)
 {
     throw SqlHelper.NotSupported(action.GetType().Name);
 }