Create.Table("Users") .WithIdColumn() .WithColumn("Name").AsString().NotNullable(); 注:WithIdColumn()是一个扩展方法,它等价于.WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity();Create.ForeignKey() .FromTable("Users").ForeignColumn("CompanyId") .ToTable("Company")....
Create.Table("Users") .WithIdColumn() .WithColumn("Name").AsString().NotNullable(); 注:WithIdColumn()是一个扩展方法,它等价于 .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity(); Create.ForeignKey() .FromTable("Users").ForeignColumn("CompanyId") .ToTable("Company").Pr...
(TdmSchema).ForeignColumn(foreignKey) .ToTable(primaryKeyTable).InSchema(TdmSchema).PrimaryColumn(primaryKey); } } private void CreateTdmSchemaIfNotExists() { if (!Schema.Schema(TdmSchema).Exists()) { Create.Schema(TdmSchema); } } private bool ColumnExists(string tableName, string columnName...
Create.Table("Users") .WithIdColumn() .WithColumn("Name").AsString().NotNullable(); 注:WithIdColumn()是一个扩展方法,它等价于.WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity(); Create.ForeignKey() .FromTable("Users").ForeignColumn("CompanyId") .ToTable("Company").Prim...