4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ridgepole で複合UKを作る

Posted at

自己メモ。

通常のindex

  t.index [:project_id], name: "idx_simple"

複合index

  t.index [:project_id, :pref_id], name: "idx_multi"

UK

  t.index [:project_id], unique: true, name: "uk_simple"

複合UK

  t.index [:project_id, :pref_id], unique: true, name: "uk_multi"

思った通りに入ってくれますね。
シンプルで素晴らしいですね。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?