【问题标题】:I built a Database and scafolded the tables I need but I Realized there is a table which one of his attribute is not needed anymore我建立了一个数据库并搭建了我需要的表,但我意识到有一个表不再需要他的一个属性
【发布时间】:2022-01-20 12:40:17
【问题描述】:

我建立了一个数据库并搭建了我需要的表,但我意识到有一个表不再需要他的一个属性 如何删除这些属性而不会出现任何问题,它们不是主键或外键或重要属性

【问题讨论】:

  • 它们长什么样子?

标签: asp.net-core model-view-controller


【解决方案1】:

如果您使用Code-first 方法,您只需删除不再需要的那个属性。然后像这样添加一个新的迁移:

Add-Migration RemovePropertyFromTablex

生成新的迁移后,更新您的数据库:

Update-Database

【讨论】:

    猜你喜欢
    • 2017-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-26
    相关资源
    最近更新 更多