mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	修正命名 NaviteTuple 为 NativeTuple
This commit is contained in:
		@@ -84,7 +84,7 @@ namespace FreeSql.Odbc.Dameng
 | 
			
		||||
                {
 | 
			
		||||
                    userId = OdbcDamengConnectionPool.GetUserId(conn.Value.ConnectionString);
 | 
			
		||||
                }
 | 
			
		||||
            var seqcols = new List<NaviteTuple<ColumnInfo, string[], bool>>(); //序列:列,表,自增
 | 
			
		||||
            var seqcols = new List<NativeTuple<ColumnInfo, string[], bool>>(); //序列:列,表,自增
 | 
			
		||||
            var seqnameDel = new List<string>(); //要删除的序列+触发器
 | 
			
		||||
 | 
			
		||||
            var sb = new StringBuilder();
 | 
			
		||||
@@ -135,7 +135,7 @@ namespace FreeSql.Odbc.Dameng
 | 
			
		||||
                        foreach (var tbcol in tb.ColumnsByPosition)
 | 
			
		||||
                        {
 | 
			
		||||
                            sb.Append(" \r\n  ").Append(_commonUtils.QuoteSqlName(tbcol.Attribute.Name)).Append(" ").Append(tbcol.Attribute.DbType).Append(",");
 | 
			
		||||
                            if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NaviteTuple.Create(tbcol, tbname, true));
 | 
			
		||||
                            if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NativeTuple.Create(tbcol, tbname, true));
 | 
			
		||||
                        }
 | 
			
		||||
                        if (tb.Primarys.Any())
 | 
			
		||||
                        {
 | 
			
		||||
@@ -246,10 +246,10 @@ where a.owner={{0}} and a.table_name={{1}}", tboldname ?? tbname);
 | 
			
		||||
                                //修改列名
 | 
			
		||||
                                sbalter.Append("execute immediate 'ALTER TABLE ").Append(_commonUtils.QuoteSqlName($"{tbname[0]}.{tbname[1]}")).Append(" RENAME COLUMN ").Append(_commonUtils.QuoteSqlName(tbstructcol.column)).Append(" TO ").Append(_commonUtils.QuoteSqlName(tbcol.Attribute.Name)).Append("';\r\n");
 | 
			
		||||
                                if (tbcol.Attribute.IsIdentity)
 | 
			
		||||
                                    seqcols.Add(NaviteTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                                    seqcols.Add(NativeTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                            }
 | 
			
		||||
                            else if (tbcol.Attribute.IsIdentity != tbstructcol.is_identity)
 | 
			
		||||
                                seqcols.Add(NaviteTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                                seqcols.Add(NativeTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                            if (isCommentChanged)
 | 
			
		||||
                                sbalter.Append("execute immediate 'COMMENT ON COLUMN ").Append(_commonUtils.QuoteSqlName($"{tbname[0]}.{tbname[1]}.{tbcol.Attribute.Name}")).Append(" IS ").Append(_commonUtils.FormatSql("{0}", tbcol.Comment ?? "").Replace("'", "''")).Append("';\r\n");
 | 
			
		||||
                            continue;
 | 
			
		||||
@@ -261,7 +261,7 @@ where a.owner={{0}} and a.table_name={{1}}", tboldname ?? tbname);
 | 
			
		||||
                            sbalter.Append("execute immediate 'UPDATE ").Append(_commonUtils.QuoteSqlName($"{tbname[0]}.{tbname[1]}")).Append(" SET ").Append(_commonUtils.QuoteSqlName(tbcol.Attribute.Name)).Append(" = ").Append(tbcol.DbDefaultValue.Replace("'", "''")).Append("';\r\n");
 | 
			
		||||
                            sbalter.Append("execute immediate 'ALTER TABLE ").Append(_commonUtils.QuoteSqlName($"{tbname[0]}.{tbname[1]}")).Append(" MODIFY ").Append(_commonUtils.QuoteSqlName(tbcol.Attribute.Name)).Append(" NOT NULL';\r\n");
 | 
			
		||||
                        }
 | 
			
		||||
                        if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NaviteTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                        if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NativeTuple.Create(tbcol, tbname, tbcol.Attribute.IsIdentity == true));
 | 
			
		||||
                        if (string.IsNullOrEmpty(tbcol.Comment) == false) sbalter.Append("execute immediate 'COMMENT ON COLUMN ").Append(_commonUtils.QuoteSqlName($"{tbname[0]}.{tbname[1]}.{tbcol.Attribute.Name}")).Append(" IS ").Append(_commonUtils.FormatSql("{0}", tbcol.Comment ?? "").Replace("'", "''")).Append("';\r\n");
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
@@ -324,7 +324,7 @@ and not exists(select 1 from all_constraints where index_name = a.index_name and
 | 
			
		||||
                foreach (var tbcol in tb.ColumnsByPosition)
 | 
			
		||||
                {
 | 
			
		||||
                    sb.Append(" \r\n  ").Append(_commonUtils.QuoteSqlName(tbcol.Attribute.Name)).Append(" ").Append(tbcol.Attribute.DbType).Append(",");
 | 
			
		||||
                    if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NaviteTuple.Create(tbcol, tbname, true));
 | 
			
		||||
                    if (tbcol.Attribute.IsIdentity == true) seqcols.Add(NativeTuple.Create(tbcol, tbname, true));
 | 
			
		||||
                }
 | 
			
		||||
                if (tb.Primarys.Any())
 | 
			
		||||
                {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user