Ejemplo n.º 1
0
        private static void GetTypeSqlToRenameColumnCommand(string columnName, SqlColumnStructure colStructure, StringBuilder builder, string alterColumn)
        {
            var colType = colStructure.Type;

            if (!String.IsNullOrEmpty(colType))
            {
                builder.AppendFormat("{0} {1} TYPE {2} USING {1}::{2},", alterColumn, columnName, colType);
            }
        }
Ejemplo n.º 2
0
        private void GetNullableSqlToRenameColumnCommand(string columnName, SqlColumnStructure colStructure, StringBuilder builder, string alterColumn)
        {
            var colNullable = colStructure.Nullable;

            if (!String.IsNullOrEmpty(colNullable))
            {
                var action = colNullable == _wordNotNull ? "SET" : "DROP";
                builder.AppendFormat("{0} {1} {2} {3},", alterColumn, columnName, action, _wordNotNull);
            }
        }
Ejemplo n.º 3
0
        private static void GetDefaultValueSqlToRenameColumnCommand(string columnName, SqlColumnStructure colStructure, StringBuilder builder, string alterColumn)
        {
            var colDefault = colStructure.Default;

            if (!String.IsNullOrEmpty(colDefault))
            {
                builder.AppendFormat("{0} {1} SET {2},", alterColumn, columnName, colDefault);
            }
        }