Skip to content

Commit cbf0497

Browse files
authored
Merge pull request #280 from uhlenbrock/rails-5-1-schema
Update schema for Rails 5.1 support
2 parents 3f25ede + 9150d94 commit cbf0497

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

spec/db/schema.rb

+23-23
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
create_table "tags" do |t|
66
t.string "name"
77
t.string "title"
8-
t.integer "parent_id"
8+
t.references "parent"
99
t.integer "sort_order"
1010
t.timestamps null: false
1111
end
1212

1313
add_foreign_key(:tags, :tags, :column => 'parent_id')
1414

1515
create_table "tag_hierarchies", :id => false do |t|
16-
t.integer "ancestor_id", :null => false
17-
t.integer "descendant_id", :null => false
16+
t.references "ancestor", :null => false
17+
t.references "descendant", :null => false
1818
t.integer "generations", :null => false
1919
end
2020

@@ -61,16 +61,16 @@
6161

6262
create_table "users" do |t|
6363
t.string "email"
64-
t.integer "referrer_id"
64+
t.references "referrer"
6565
t.integer "group_id"
6666
t.timestamps null: false
6767
end
6868

6969
add_foreign_key(:users, :users, :column => 'referrer_id')
7070

7171
create_table "contracts" do |t|
72-
t.integer "user_id", :null => false
73-
t.integer "contract_type_id"
72+
t.references "user", :null => false
73+
t.references "contract_type"
7474
t.string "title"
7575
end
7676

@@ -79,8 +79,8 @@
7979
end
8080

8181
create_table "referral_hierarchies", :id => false do |t|
82-
t.integer "ancestor_id", :null => false
83-
t.integer "descendant_id", :null => false
82+
t.references "ancestor", :null => false
83+
t.references "descendant", :null => false
8484
t.integer "generations", :null => false
8585
end
8686

@@ -91,14 +91,14 @@
9191
t.string "name"
9292
t.string "type"
9393
t.integer "column_whereby_ordering_is_inferred"
94-
t.integer "mother_id"
94+
t.references "mother"
9595
end
9696

9797
add_foreign_key(:labels, :labels, :column => 'mother_id')
9898

9999
create_table "label_hierarchies", :id => false do |t|
100-
t.integer "ancestor_id", :null => false
101-
t.integer "descendant_id", :null => false
100+
t.references "ancestor", :null => false
101+
t.references "descendant", :null => false
102102
t.integer "generations", :null => false
103103
end
104104

@@ -107,28 +107,28 @@
107107

108108
create_table "cuisine_types" do |t|
109109
t.string "name"
110-
t.integer "parent_id"
110+
t.references "parent"
111111
end
112112

113113
create_table "cuisine_type_hierarchies", :id => false do |t|
114-
t.integer "ancestor_id", :null => false
115-
t.integer "descendant_id", :null => false
114+
t.references "ancestor", :null => false
115+
t.references "descendant", :null => false
116116
t.integer "generations", :null => false
117117
end
118118

119119
create_table "namespace_types" do |t|
120120
t.string "name"
121-
t.integer "parent_id"
121+
t.references "parent"
122122
end
123123

124124
create_table "namespace_type_hierarchies", :id => false do |t|
125-
t.integer "ancestor_id", :null => false
126-
t.integer "descendant_id", :null => false
125+
t.references "ancestor", :null => false
126+
t.references "descendant", :null => false
127127
t.integer "generations", :null => false
128128
end
129129

130130
create_table "metal" do |t|
131-
t.integer "parent_id"
131+
t.references "parent"
132132
t.string "metal_type"
133133
t.string "value"
134134
t.string "description"
@@ -138,8 +138,8 @@
138138
add_foreign_key(:metal, :metal, :column => 'parent_id')
139139

140140
create_table "metal_hierarchies", :id => false do |t|
141-
t.integer "ancestor_id", :null => false
142-
t.integer "descendant_id", :null => false
141+
t.references "ancestor", :null => false
142+
t.references "descendant", :null => false
143143
t.integer "generations", :null => false
144144
end
145145

@@ -148,15 +148,15 @@
148148

149149
create_table 'menu_items' do |t|
150150
t.string 'name'
151-
t.integer 'parent_id'
151+
t.references 'parent'
152152
t.timestamps null: false
153153
end
154154

155155
add_foreign_key(:menu_items, :menu_items, :column => 'parent_id')
156156

157157
create_table 'menu_item_hierarchies', :id => false do |t|
158-
t.integer 'ancestor_id', :null => false
159-
t.integer 'descendant_id', :null => false
158+
t.references 'ancestor', :null => false
159+
t.references 'descendant', :null => false
160160
t.integer 'generations', :null => false
161161
end
162162

0 commit comments

Comments
 (0)