当前位置:网站首页>EFCore Migrations的深入研究
EFCore Migrations的深入研究
2022-07-26 19:03:00 【算盘】
1、使用迁移脚本,可以对当前连接的数据库执行编号更高的迁移,这个操作叫做“向上迁移(Up)”,也可以执行把数据库回退到旧的迁移,这个操作叫"向下迁移(Down)"
2、除非有特殊需要,否则不要删除Migratons文件下的代码
3、进一步分析Migrations下的代码。分析Up、Down等方法。查看Migration编号
4、查看数据库的dbo._EFMigrationsHistory表:记录当前数据库曾经应用过的迁移脚本,按顺序排列
Migrations其他命令
1、Update-Database XXX
把数据库回滚或升级到XXX的状态,迁移脚本不动
2、Remove-migration
删除最后一次的迁移脚本
3、Script-Migration
生成迁移SQL代码。
有了Update-Database为什么还要生成SQL脚本
可以生成版本D到版本F的SQL脚本:
Script-Migration D F
生成版本D到最新版本的SQL脚本:Script-Migration D
边栏推荐
- Linear algebra Chapter 4 linear equations
- JWT 实现登录认证 + Token 自动续期方案,这才是正确的使用姿势!
- [PHP] common header definitions
- After working for 13 years, I have a little software testing experience and feelings
- 【二叉树】将二叉搜索树变平衡
- DOM case: 10 second countdown - write jump page related knowledge
- Three paradigms of database design
- 使用ECS和OSS搭建个人网盘
- Excel-VBA 快速上手(十二、Like 比较的常见用法)
- 亲力亲为的思考
猜你喜欢

Training embedded representation of large categories using triple loss and twin neural networks

2022/07/26 learning notes (day16) abstraction and interface

Leetcode daily practice - 26. Delete duplicates in an ordered array

Overview of canvas

金融机构导图

LeetCode每日一练 —— 26. 删除有序数组中的重复项

知识管理系统是什么?你需要知道这些

Leetcode daily practice - 189. Rotation array

canvas 图形

Codeforces Round #810 (Div. 2)(A~C)
随机推荐
2022/07/26 learning notes (day16) abstraction and interface
LeetCode每日一练 —— 27. 移除元素
Ijcai2022 meeting! Brescia et al. Tutorial of evidential reasoning and learning, describing its latest progress, with 96 slides attached
Leetcode daily practice - 27. Remove elements
银行业务分类
Household deposits increased by 10.33 trillion yuan in the first half of the year, with an average of 57.1 billion deposits pouring into banks every day
[PHP] use file_ get_ Contents() sends get and post requests
Uiobject2 of uiautomator2 common classes
软件测试——自动化测试框架有哪些?
The authentication type 10 is not supported
使用三重损失和孪生神经网络训练大型类目的嵌入表示
MySQL subquery usage
Linear algebra Chapter 4 linear equations
Chapter 9 practical modeling technology
Latte dht-phev products are very popular. Will the sales volume make Li Ruifeng figure it out?
Summary of iPhone development data persistence (final) - Comparison of five data persistence methods
亲力亲为的思考
win11 edge怎么卸载?win11 edge浏览器彻底卸载的方法教程
Scope in JS
Excel-VBA 快速上手(十二、Like 比较的常见用法)