mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
656 B
656 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| Partial indexes are useful for enforcing rules that only apply conditionally | 1527688613932044289 | weekly-thread-2022-20 | tobias_petry |
|
2022-05-20T16:32:03+00:00 | partial-indexes-are-useful-for-enforcing-rules-that-only-apply-conditionally |
⚡️ Database Tip
Sometimes you want to make columns unique but you can't because e.g. there are still soft-deleted rows in the table witht the same value. By only including relevant rows (partial index) you can still enforce uniqueness, and you can even simulate it for MySQL!