Skip to content

Commit

Permalink
- 修复 Firebird 表注释迁移问题(列注释正常);#1913
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Dec 5, 2024
1 parent 48ea72e commit 8593bac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Examples/base_entity/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ static void Main(string[] args)
//.UseSlaveWeight(10, 1, 1, 5)


//.UseConnectionString(FreeSql.DataType.Firebird, @"database=localhost:D:\fbdata\EXAMPLES.fdb;user=sysdba;password=123456;max pool size=5")
.UseConnectionString(FreeSql.DataType.Firebird, @"database=localhost:D:\fbdata\EXAMPLES.fdb;user=sysdba;password=123456;max pool size=5")
//.UseQuoteSqlName(false)

//.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;min pool size=1;Max pool size=3;AllowLoadLocalInfile=true")

//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
//.UseAdoConnectionPool(false)
.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
//.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
////.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=toc;Pooling=true;Maximum Pool Size=2")
.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)

//.UseConnectionString(FreeSql.DataType.Oracle, "user id=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
Expand Down Expand Up @@ -619,6 +619,8 @@ static void Main(string[] args)
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
#endregion

fsql.CodeFirst.SyncStructure<Account>();


var dbpars = new List<DbParameter>();

Expand Down Expand Up @@ -3310,6 +3312,9 @@ public partial class ProjectItem

}

/// <summary>
/// 账户
/// </summary>
[Table(Name = "t_account")]
public class Account
{
Expand Down
5 changes: 5 additions & 0 deletions Examples/base_entity/base_entity.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Providers/FreeSql.Provider.Firebird/FirebirdCodeFirst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ from rdb$indices d
sb.Remove(sb.Length - 2, 2).Append(");\r\n");
}
}
var dbcomment = string.Concat(_orm.Ado.ExecuteScalar(CommandType.Text, _commonUtils.FormatSql(@" select trim(rdb$external_description) from rdb$relations where rdb$system_flag=0 and trim(rdb$relation_name) = {0}", tbname)));
var dbcomment = string.Concat(_orm.Ado.ExecuteScalar(CommandType.Text, _commonUtils.FormatSql(@" select trim(rdb$description) from rdb$relations where rdb$system_flag=0 and trim(rdb$relation_name) = {0}", tbname)));
if (dbcomment != (tb.Comment ?? ""))
sb.Append("ALTER TABLE ").Append(_commonUtils.QuoteSqlName(tbname)).Append(" COMMENT ").Append(" ").Append(_commonUtils.FormatSql("{0}", tb.Comment ?? "")).Append(";\r\n");
sb.Append("COMMENT ON TABLE ").Append(_commonUtils.QuoteSqlName(tbname)).Append(" IS ").Append(_commonUtils.FormatSql("{0}", tb.Comment ?? "")).Append(";\r\n");
}
return sb.Length == 0 ? null : sb.ToString();
}
Expand Down

0 comments on commit 8593bac

Please sign in to comment.