Skip to content

Commit 510c7e0

Browse files
committed
Updates SUMMARY.md
Auto commit by GitBook Editor
1 parent fbb990c commit 510c7e0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* [什麼是 Polymorphic Association](poly.md)
1111
* [Model.find 和 Model.find_by](find.md)
1212
* [N+1 Query](nplusone.md)
13+
* [為什麼要有 Migration 檔案](migration.md)
1314
* [如何用單一 action 套用 /beer/(beer\_type) 這種 route](beer_type.md)
1415
* [如何讓 Person model 可以指定另一個 person 為 parent](person.md)
1516
* [CSRF 是什麼](csrf.md)

migration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 為什麼要有 Migration 檔案
2+
3+
Migration 檔案的用意在於,讓每一次資料庫修改都能夠被記錄進版本控制。以防止多人協作或開發 / 測試 / 正式環境資料庫 schema 的不一致。
4+
5+
而另一個較不為人知的優點是,Migration 背後針對不同類型的資料庫 ( 比方 MySQL vs PostgreSQL ) 可以進行相同的處理,減少開發者考慮在 A DB 和 B DB 進行資料庫操作的語法差異。

0 commit comments

Comments
 (0)