没有太多信息/帮助,以获取有关这一点,但我没有为我工作(虽然很tidious工作)以下:
我不得不完全重写自动创建向上()和向下()迁移中的方法。使用CreateTable()创建表而不是重命名视图。
在向上()方法:
CreateTable(
"dbo.Company",
c => new
{
CompanyId = c.Guid(nullable:false),
ParentAccount = c.String(maxLength:160),
Country = c.String(maxLength:100),
Address1_City = c.String(maxLength:4000),
Address1_Country = c.String(maxLength: 4000),
Address1_Line1 = c.String(maxLength: 4000),
Address1_Line2 = c.String(maxLength: 4000),
Address1_PostalCode = c.String(maxLength:50),
Owner = c.String(maxLength:160),
OwnerId = c.Guid(nullable:false),
Name = c.String(maxLength:160),
EMailAddress = c.String(maxLength:100),
InvoiceEMailAddress = c.String(maxLength:100),
Fax = c.String(maxLength:50),
CreditLimit = c.Decimal(storeType:"money"),
CreditOnHold = c.Boolean(nullable:false, defaultValue:false),
IsPrivate = c.Boolean(nullable:false, defaultValue:false),
StatusCode = c.Int(),
CustomerTypeCode = c.Int(),
BEGreenCreditLimit = c.Int(),
IssuingBodyAccount = c.String(maxLength:20),
CustomerType = c.String(maxLength:100),
IsElProducer = c.Boolean(nullable:false, defaultValue:false),
IsEnergyTrader = c.Boolean(nullable:false,defaultValue:false),
VATNumber = c.String(maxLength:100),
ContactPerson = c.String(maxLength:160),
ContactPersonPhone = c.String(maxLength:50),
ContactPersonFax = c.String(maxLength:50),
ContactPersonEmail = c.String(maxLength:100)
}
)
.PrimaryKey(p=>p.CompanyId)
;
从另一个数据库中提取的值公司,REF为一些列的长最大长度。