poly_belongs_to 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -15
- data/lib/poly_belongs_to.rb +6 -96
- data/lib/poly_belongs_to/core.rb +92 -0
- data/lib/poly_belongs_to/dup.rb +13 -10
- data/lib/poly_belongs_to/faked_collection.rb +6 -2
- data/lib/poly_belongs_to/{poly_belongs_to.rb → pbt.rb} +10 -16
- data/lib/poly_belongs_to/singleton_set.rb +45 -0
- data/lib/poly_belongs_to/version.rb +1 -1
- data/test/core_test.rb +203 -0
- data/test/dummy/app/models/alpha.rb +4 -0
- data/test/dummy/app/models/beta.rb +4 -0
- data/test/dummy/app/models/capa.rb +4 -0
- data/test/dummy/app/models/delta.rb +4 -0
- data/test/dummy/db/migrate/20150322233720_create_alphas.rb +10 -0
- data/test/dummy/db/migrate/20150322233733_create_beta.rb +10 -0
- data/test/dummy/db/migrate/20150322233743_create_capas.rb +10 -0
- data/test/dummy/db/migrate/20150322233755_create_delta.rb +10 -0
- data/test/dummy/db/schema.rb +37 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +145 -0
- data/test/dummy/log/test.log +133008 -0
- data/test/dup_test.rb +66 -33
- data/test/faked_collection_test.rb +77 -62
- data/test/pbt_test.rb +93 -89
- data/test/singleton_set_test.rb +44 -0
- data/test/test_helper.rb +2 -2
- metadata +26 -6
- data/test/poly_belongs_to_test.rb +0 -200
data/test/core_test.rb
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
|
4
|
+
class CoreTest < ActiveSupport::TestCase
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
describe PolyBelongsTo::Core do
|
8
|
+
|
9
|
+
it "is a module" do
|
10
|
+
PolyBelongsTo::Core.must_be_kind_of Module
|
11
|
+
end
|
12
|
+
|
13
|
+
it "#poly? User as not polymorphic" do
|
14
|
+
user = users(:bob)
|
15
|
+
user.wont_be :poly?
|
16
|
+
User.wont_be :poly?
|
17
|
+
end
|
18
|
+
|
19
|
+
it "#poly? Tag as not polymorphic" do
|
20
|
+
tag = tags(:bob_tag)
|
21
|
+
tag.wont_be :poly?
|
22
|
+
Tag.wont_be :poly?
|
23
|
+
end
|
24
|
+
|
25
|
+
it "#poly? Phone as polymorphic" do
|
26
|
+
phone = phones(:bob_phone)
|
27
|
+
phone.must_be :poly?
|
28
|
+
Phone.must_be :poly?
|
29
|
+
end
|
30
|
+
|
31
|
+
it "#pbt User belongs to table as nil" do
|
32
|
+
user = users(:bob)
|
33
|
+
user.pbt.must_be_nil
|
34
|
+
User.pbt.must_be_nil
|
35
|
+
end
|
36
|
+
|
37
|
+
it "#pbt Tag belongs to table as :user" do
|
38
|
+
tag = tags(:bob_tag)
|
39
|
+
tag.pbt.must_be_same_as :user
|
40
|
+
Tag.pbt.must_be_same_as :user
|
41
|
+
end
|
42
|
+
|
43
|
+
it "#pbt Phone belongs to table as :phoneable" do
|
44
|
+
phone = phones(:bob_phone)
|
45
|
+
phone.pbt.must_be_same_as :phoneable
|
46
|
+
Phone.pbt.must_be_same_as :phoneable
|
47
|
+
end
|
48
|
+
|
49
|
+
it "#pbts multiple parents" do
|
50
|
+
tire = tires(:low_profile1)
|
51
|
+
parents = tire.class.pbts
|
52
|
+
parents.must_be_kind_of Array
|
53
|
+
parents.must_include :user
|
54
|
+
parents.must_include :car
|
55
|
+
parents = tire.pbts
|
56
|
+
parents.must_be_kind_of Array
|
57
|
+
parents.must_include :user
|
58
|
+
parents.must_include :car
|
59
|
+
end
|
60
|
+
|
61
|
+
it "#pbt_params_name User params name as :user" do
|
62
|
+
user = users(:bob)
|
63
|
+
user.pbt_params_name.must_be_same_as :user
|
64
|
+
User.pbt_params_name.must_be_same_as :user
|
65
|
+
User.pbt_params_name(true).must_be_same_as :user
|
66
|
+
User.pbt_params_name(false).must_be_same_as :user
|
67
|
+
end
|
68
|
+
|
69
|
+
it "#pbt_params_name Tag params name as :tag" do
|
70
|
+
tag = tags(:bob_tag)
|
71
|
+
tag.pbt_params_name.must_be_same_as :tag
|
72
|
+
Tag.pbt_params_name.must_be_same_as :tag
|
73
|
+
Tag.pbt_params_name(true).must_be_same_as :tag
|
74
|
+
Tag.pbt_params_name(false).must_be_same_as :tag
|
75
|
+
end
|
76
|
+
|
77
|
+
it "#pbt_params_name Phone params name as :phones_attributes" do
|
78
|
+
phone = phones(:bob_phone)
|
79
|
+
phone.pbt_params_name.must_be_same_as :phones_attributes
|
80
|
+
Phone.pbt_params_name.must_be_same_as :phones_attributes
|
81
|
+
Phone.pbt_params_name(true).must_be_same_as :phones_attributes
|
82
|
+
end
|
83
|
+
|
84
|
+
it "#pbt_params_name Phone params name with false as :phone" do
|
85
|
+
phone = phones(:bob_phone)
|
86
|
+
phone.pbt_params_name(false).must_be_same_as :phone
|
87
|
+
Phone.pbt_params_name(false).must_be_same_as :phone
|
88
|
+
end
|
89
|
+
|
90
|
+
it "#pbt_id_sym User belongs to field id symbol as nil" do
|
91
|
+
user = users(:bob)
|
92
|
+
user.pbt_id_sym.must_be_nil
|
93
|
+
User.pbt_id_sym.must_be_nil
|
94
|
+
end
|
95
|
+
|
96
|
+
it "#pbt_id_sym Tag belongs to field id symbol as :tag_id" do
|
97
|
+
tag = tags(:bob_tag)
|
98
|
+
tag.pbt_id_sym.must_be_same_as :user_id
|
99
|
+
Tag.pbt_id_sym.must_be_same_as :user_id
|
100
|
+
end
|
101
|
+
|
102
|
+
it "#pbt_id_sym Phone belongs to field id symbol as :phoneable_id" do
|
103
|
+
phone = phones(:bob_phone)
|
104
|
+
phone.pbt_id_sym.must_be_same_as :phoneable_id
|
105
|
+
Phone.pbt_id_sym.must_be_same_as :phoneable_id
|
106
|
+
end
|
107
|
+
|
108
|
+
it "#pbt_type_sym User belongs to field type symbol as nil" do
|
109
|
+
user = users(:bob)
|
110
|
+
user.pbt_type_sym.must_be_nil
|
111
|
+
User.pbt_type_sym.must_be_nil
|
112
|
+
end
|
113
|
+
|
114
|
+
it "#pbt_type_sym Tag belongs to field type symbol as nil" do
|
115
|
+
tag = tags(:bob_tag)
|
116
|
+
tag.pbt_type_sym.must_be_nil
|
117
|
+
Tag.pbt_type_sym.must_be_nil
|
118
|
+
end
|
119
|
+
|
120
|
+
it "#pbt_type_sym Phone belongs to field type symbol as :phoneable_type" do
|
121
|
+
phone = phones(:bob_phone)
|
122
|
+
phone.pbt_type_sym.must_be_same_as :phoneable_type
|
123
|
+
Phone.pbt_type_sym.must_be_same_as :phoneable_type
|
124
|
+
end
|
125
|
+
|
126
|
+
it "#pbt_id User belongs to id as nil" do
|
127
|
+
user = users(:bob)
|
128
|
+
user.pbt_id.must_be_nil
|
129
|
+
end
|
130
|
+
|
131
|
+
it "#pbt_id Tag belongs to id as user's id" do
|
132
|
+
tag = tags(:bob_tag)
|
133
|
+
tag.pbt_id.must_be_same_as ActiveRecord::FixtureSet.identify(:bob)
|
134
|
+
end
|
135
|
+
|
136
|
+
it "#pbt_id Phone belongs to id as user's profile id" do
|
137
|
+
phone = phones(:bob_phone)
|
138
|
+
phone.pbt_id.must_be_same_as ActiveRecord::FixtureSet.identify(:bob_prof)
|
139
|
+
end
|
140
|
+
|
141
|
+
it "#pbt_type User belongs to type as nil" do
|
142
|
+
user = users(:bob)
|
143
|
+
user.pbt_type.must_be_nil
|
144
|
+
end
|
145
|
+
|
146
|
+
it "#pbt_type Tag belongs to type as nil" do
|
147
|
+
tag = tags(:bob_tag)
|
148
|
+
tag.pbt_type.must_be_nil
|
149
|
+
end
|
150
|
+
|
151
|
+
it "#pbt_type Phone belongs to type as 'Profile'" do
|
152
|
+
phone = phones(:bob_phone)
|
153
|
+
phone.pbt_type.must_equal "Profile"
|
154
|
+
end
|
155
|
+
|
156
|
+
it "#pbt_parent User parent returns nil" do
|
157
|
+
user = users(:bob)
|
158
|
+
user.pbt_parent.must_be_nil
|
159
|
+
end
|
160
|
+
|
161
|
+
it "#pbt_parent Tag parent returns user instance" do
|
162
|
+
user = users(:bob)
|
163
|
+
tag = user.tags.build
|
164
|
+
tag.pbt_parent.id.must_be_same_as user.id
|
165
|
+
end
|
166
|
+
|
167
|
+
it "#pbt_parent Phone parent returns profile" do
|
168
|
+
user = users(:bob)
|
169
|
+
profile = user.profiles.build
|
170
|
+
phone = profile.phones.build
|
171
|
+
profile.save
|
172
|
+
phone.pbt_parent.id.must_be_same_as profile.id
|
173
|
+
end
|
174
|
+
|
175
|
+
it "#pbt_parent Profile parent returns user" do
|
176
|
+
user = users(:bob)
|
177
|
+
profile = user.profiles.build
|
178
|
+
profile.save
|
179
|
+
profile.pbt_parent.id.must_be_same_as user.id
|
180
|
+
end
|
181
|
+
|
182
|
+
it "#pbt_parents can show multiple parents" do
|
183
|
+
user = User.new(id: 1)
|
184
|
+
user.cars.build
|
185
|
+
user.cars.first.tires.build(user_id: user.id)
|
186
|
+
user.save
|
187
|
+
parents = user.cars.first.tires.first.pbt_parents
|
188
|
+
parents.must_be_kind_of Array
|
189
|
+
parents.must_include user
|
190
|
+
parents.must_include user.cars.first
|
191
|
+
user.destroy
|
192
|
+
end
|
193
|
+
|
194
|
+
it "#pbt_parents one parent for polymorphic" do
|
195
|
+
bob_address = addresses(:bob_address)
|
196
|
+
parents = bob_address.pbt_parents
|
197
|
+
parents.must_be_kind_of Array
|
198
|
+
parents.size.must_equal 1
|
199
|
+
parents.first.must_equal profiles(:bob_prof)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150322233755) do
|
15
15
|
|
16
16
|
create_table "addresses", force: true do |t|
|
17
17
|
t.integer "addressable_id"
|
@@ -23,6 +23,33 @@ ActiveRecord::Schema.define(version: 20150301100722) do
|
|
23
23
|
|
24
24
|
add_index "addresses", ["addressable_id", "addressable_type"], name: "index_addresses_on_addressable_id_and_addressable_type"
|
25
25
|
|
26
|
+
create_table "alphas", force: true do |t|
|
27
|
+
t.string "content"
|
28
|
+
t.integer "delta_id"
|
29
|
+
t.datetime "created_at"
|
30
|
+
t.datetime "updated_at"
|
31
|
+
end
|
32
|
+
|
33
|
+
add_index "alphas", ["delta_id"], name: "index_alphas_on_delta_id"
|
34
|
+
|
35
|
+
create_table "beta", force: true do |t|
|
36
|
+
t.string "content"
|
37
|
+
t.integer "alpha_id"
|
38
|
+
t.datetime "created_at"
|
39
|
+
t.datetime "updated_at"
|
40
|
+
end
|
41
|
+
|
42
|
+
add_index "beta", ["alpha_id"], name: "index_beta_on_alpha_id"
|
43
|
+
|
44
|
+
create_table "capas", force: true do |t|
|
45
|
+
t.string "content"
|
46
|
+
t.integer "beta_id"
|
47
|
+
t.datetime "created_at"
|
48
|
+
t.datetime "updated_at"
|
49
|
+
end
|
50
|
+
|
51
|
+
add_index "capas", ["beta_id"], name: "index_capas_on_beta_id"
|
52
|
+
|
26
53
|
create_table "cars", force: true do |t|
|
27
54
|
t.integer "user_id"
|
28
55
|
t.string "content"
|
@@ -41,6 +68,15 @@ ActiveRecord::Schema.define(version: 20150301100722) do
|
|
41
68
|
|
42
69
|
add_index "contacts", ["user_id"], name: "index_contacts_on_user_id"
|
43
70
|
|
71
|
+
create_table "delta", force: true do |t|
|
72
|
+
t.string "content"
|
73
|
+
t.integer "capa_id"
|
74
|
+
t.datetime "created_at"
|
75
|
+
t.datetime "updated_at"
|
76
|
+
end
|
77
|
+
|
78
|
+
add_index "delta", ["capa_id"], name: "index_delta_on_capa_id"
|
79
|
+
|
44
80
|
create_table "geo_locations", force: true do |t|
|
45
81
|
t.integer "address_id"
|
46
82
|
t.string "content"
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -169,3 +169,148 @@ Migrating to CreateGeoLocations (20150220213422)
|
|
169
169
|
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
|
170
170
|
[1m[36m (13.0ms)[0m [1mcommit transaction[0m
|
171
171
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
172
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
173
|
+
SQLite3::SQLException: no such table: users: SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
174
|
+
[1m[36m (12.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
175
|
+
[1m[35m (17.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
176
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
177
|
+
Migrating to CreateUsers (20150211224139)
|
178
|
+
[1m[35m (0.1ms)[0m begin transaction
|
179
|
+
[1m[36m (0.8ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
180
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224139"]]
|
181
|
+
[1m[36m (26.8ms)[0m [1mcommit transaction[0m
|
182
|
+
Migrating to CreateTags (20150211224157)
|
183
|
+
[1m[35m (0.2ms)[0m begin transaction
|
184
|
+
[1m[36m (0.6ms)[0m [1mCREATE TABLE "tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
185
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_tags_on_user_id" ON "tags" ("user_id")
|
186
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150211224157"]]
|
187
|
+
[1m[35m (30.4ms)[0m commit transaction
|
188
|
+
Migrating to CreatePhones (20150211224225)
|
189
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
190
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "phones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "phoneable_id" integer, "phoneable_type" varchar(255), "content" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
191
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_phones_on_phoneable_id_and_phoneable_type" ON "phones" ("phoneable_id", "phoneable_type")[0m
|
192
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224225"]]
|
193
|
+
[1m[36m (22.8ms)[0m [1mcommit transaction[0m
|
194
|
+
Migrating to CreateAddresses (20150216092218)
|
195
|
+
[1m[35m (0.1ms)[0m begin transaction
|
196
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_id" integer, "addressable_type" varchar(255), "content" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
197
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_addresses_on_addressable_id_and_addressable_type" ON "addresses" ("addressable_id", "addressable_type")
|
198
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092218"]]
|
199
|
+
[1m[35m (24.7ms)[0m commit transaction
|
200
|
+
Migrating to CreateProfiles (20150216092338)
|
201
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
202
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "profileable_id" integer, "profileable_type" varchar(255), "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
203
|
+
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_profiles_on_profileable_id_and_profileable_type" ON "profiles" ("profileable_id", "profileable_type")[0m
|
204
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092338"]]
|
205
|
+
[1m[36m (29.0ms)[0m [1mcommit transaction[0m
|
206
|
+
Migrating to CreatePhotos (20150216092411)
|
207
|
+
[1m[35m (0.2ms)[0m begin transaction
|
208
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "photos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "photoable_id" integer, "photoable_type" varchar(255), "content" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
209
|
+
[1m[35m (0.6ms)[0m CREATE INDEX "index_photos_on_photoable_id_and_photoable_type" ON "photos" ("photoable_id", "photoable_type")
|
210
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092411"]]
|
211
|
+
[1m[35m (36.3ms)[0m commit transaction
|
212
|
+
Migrating to CreateContacts (20150216092449)
|
213
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
214
|
+
[1m[35m (0.5ms)[0m CREATE TABLE "contacts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
215
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_contacts_on_user_id" ON "contacts" ("user_id")[0m
|
216
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092449"]]
|
217
|
+
[1m[36m (23.9ms)[0m [1mcommit transaction[0m
|
218
|
+
Migrating to CreateSsns (20150216092519)
|
219
|
+
[1m[35m (0.1ms)[0m begin transaction
|
220
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "ssns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
221
|
+
[1m[35m (0.2ms)[0m CREATE INDEX "index_ssns_on_user_id" ON "ssns" ("user_id")
|
222
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092519"]]
|
223
|
+
[1m[35m (18.0ms)[0m commit transaction
|
224
|
+
Migrating to CreateGeoLocations (20150220213422)
|
225
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
226
|
+
[1m[35m (1.1ms)[0m CREATE TABLE "geo_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
227
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_geo_locations_on_address_id" ON "geo_locations" ("address_id")[0m
|
228
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
|
229
|
+
[1m[36m (12.7ms)[0m [1mcommit transaction[0m
|
230
|
+
Migrating to CreateSquishies (20150220230146)
|
231
|
+
[1m[35m (0.1ms)[0m begin transaction
|
232
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "squishies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "squishable_id" integer, "squishable_type" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
233
|
+
[1m[35m (0.4ms)[0m CREATE INDEX "index_squishies_on_squishable_id_and_squishable_type" ON "squishies" ("squishable_id", "squishable_type")
|
234
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150220230146"]]
|
235
|
+
[1m[35m (29.9ms)[0m commit transaction
|
236
|
+
Migrating to CreateTires (20150301100658)
|
237
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
238
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "tires" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "car_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
239
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_tires_on_user_id" ON "tires" ("user_id")[0m
|
240
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_tires_on_car_id" ON "tires" ("car_id")
|
241
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150301100658"]]
|
242
|
+
[1m[35m (20.0ms)[0m commit transaction
|
243
|
+
Migrating to CreateCars (20150301100722)
|
244
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
245
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "cars" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
246
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_cars_on_user_id" ON "cars" ("user_id")[0m
|
247
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150301100722"]]
|
248
|
+
[1m[36m (26.4ms)[0m [1mcommit transaction[0m
|
249
|
+
Migrating to A (20150322233057)
|
250
|
+
[1m[35m (0.1ms)[0m begin transaction
|
251
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150322233057"]]
|
252
|
+
[1m[35m (20.7ms)[0m commit transaction
|
253
|
+
Migrating to B (20150322233103)
|
254
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
255
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233103"]]
|
256
|
+
[1m[36m (17.0ms)[0m [1mcommit transaction[0m
|
257
|
+
Migrating to C (20150322233108)
|
258
|
+
[1m[35m (0.2ms)[0m begin transaction
|
259
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150322233108"]]
|
260
|
+
[1m[35m (20.3ms)[0m commit transaction
|
261
|
+
Migrating to D (20150322233117)
|
262
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
263
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233117"]]
|
264
|
+
[1m[36m (21.8ms)[0m [1mcommit transaction[0m
|
265
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.3ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
266
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
267
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
268
|
+
Migrating to D (20150322233117)
|
269
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
270
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233117'
|
271
|
+
[1m[36m (11.9ms)[0m [1mcommit transaction[0m
|
272
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
273
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
274
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
275
|
+
Migrating to C (20150322233108)
|
276
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
277
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233108'
|
278
|
+
[1m[36m (18.9ms)[0m [1mcommit transaction[0m
|
279
|
+
Migrating to B (20150322233103)
|
280
|
+
[1m[35m (0.2ms)[0m begin transaction
|
281
|
+
[1m[36mSQL (0.4ms)[0m [1mDELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233103'[0m
|
282
|
+
[1m[35m (16.9ms)[0m commit transaction
|
283
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
284
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
285
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
286
|
+
Migrating to A (20150322233057)
|
287
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
288
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233057'
|
289
|
+
[1m[36m (14.3ms)[0m [1mcommit transaction[0m
|
290
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
291
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
292
|
+
Migrating to CreateAlphas (20150322233720)
|
293
|
+
[1m[35m (0.1ms)[0m begin transaction
|
294
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "alphas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "delta_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
295
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_alphas_on_delta_id" ON "alphas" ("delta_id")
|
296
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150322233720"]]
|
297
|
+
[1m[35m (13.2ms)[0m commit transaction
|
298
|
+
Migrating to CreateBeta (20150322233733)
|
299
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
300
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "beta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "alpha_id" integer, "created_at" datetime, "updated_at" datetime)
|
301
|
+
[1m[36m (0.6ms)[0m [1mCREATE INDEX "index_beta_on_alpha_id" ON "beta" ("alpha_id")[0m
|
302
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233733"]]
|
303
|
+
[1m[36m (12.4ms)[0m [1mcommit transaction[0m
|
304
|
+
Migrating to CreateCapas (20150322233743)
|
305
|
+
[1m[35m (0.2ms)[0m begin transaction
|
306
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "capas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "beta_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
307
|
+
[1m[35m (0.4ms)[0m CREATE INDEX "index_capas_on_beta_id" ON "capas" ("beta_id")
|
308
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150322233743"]]
|
309
|
+
[1m[35m (12.9ms)[0m commit transaction
|
310
|
+
Migrating to CreateDelta (20150322233755)
|
311
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
312
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "delta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "capa_id" integer, "created_at" datetime, "updated_at" datetime)
|
313
|
+
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_delta_on_capa_id" ON "delta" ("capa_id")[0m
|
314
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233755"]]
|
315
|
+
[1m[36m (12.5ms)[0m [1mcommit transaction[0m
|
316
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.3ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|