poly_belongs_to 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,4 @@
1
+ class Alpha < ActiveRecord::Base
2
+ belongs_to :delta
3
+ has_many :betas
4
+ end
@@ -0,0 +1,4 @@
1
+ class Beta < ActiveRecord::Base
2
+ belongs_to :alpha
3
+ has_many :capas
4
+ end
@@ -0,0 +1,4 @@
1
+ class Capa < ActiveRecord::Base
2
+ belongs_to :beta
3
+ has_many :deltas
4
+ end
@@ -0,0 +1,4 @@
1
+ class Delta < ActiveRecord::Base
2
+ belongs_to :capa
3
+ has_many :alphas
4
+ end
@@ -0,0 +1,10 @@
1
+ class CreateAlphas < ActiveRecord::Migration
2
+ def change
3
+ create_table :alphas do |t|
4
+ t.string :content
5
+ t.references :delta, index: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBeta < ActiveRecord::Migration
2
+ def change
3
+ create_table :beta do |t|
4
+ t.string :content
5
+ t.references :alpha, index: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateCapas < ActiveRecord::Migration
2
+ def change
3
+ create_table :capas do |t|
4
+ t.string :content
5
+ t.references :beta, index: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateDelta < ActiveRecord::Migration
2
+ def change
3
+ create_table :delta do |t|
4
+ t.string :content
5
+ t.references :capa, index: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -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: 20150301100722) do
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"
Binary file
@@ -169,3 +169,148 @@ Migrating to CreateGeoLocations (20150220213422)
169
169
  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
170
170
   (13.0ms) commit transaction
171
171
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
172
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
173
+ SQLite3::SQLException: no such table: users: SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
174
+  (12.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
175
+  (17.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
176
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
177
+ Migrating to CreateUsers (20150211224139)
178
+  (0.1ms) begin transaction
179
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
180
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224139"]]
181
+  (26.8ms) commit transaction
182
+ Migrating to CreateTags (20150211224157)
183
+  (0.2ms) begin transaction
184
+  (0.6ms) CREATE 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) 
185
+  (0.3ms) CREATE INDEX "index_tags_on_user_id" ON "tags" ("user_id")
186
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224157"]]
187
+  (30.4ms) commit transaction
188
+ Migrating to CreatePhones (20150211224225)
189
+  (0.1ms) begin transaction
190
+  (0.6ms) 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
+  (0.3ms) CREATE INDEX "index_phones_on_phoneable_id_and_phoneable_type" ON "phones" ("phoneable_id", "phoneable_type")
192
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224225"]]
193
+  (22.8ms) commit transaction
194
+ Migrating to CreateAddresses (20150216092218)
195
+  (0.1ms) begin transaction
196
+  (0.3ms) CREATE 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) 
197
+  (0.1ms) CREATE INDEX "index_addresses_on_addressable_id_and_addressable_type" ON "addresses" ("addressable_id", "addressable_type")
198
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092218"]]
199
+  (24.7ms) commit transaction
200
+ Migrating to CreateProfiles (20150216092338)
201
+  (0.1ms) begin transaction
202
+  (0.8ms) 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
+  (0.4ms) CREATE INDEX "index_profiles_on_profileable_id_and_profileable_type" ON "profiles" ("profileable_id", "profileable_type")
204
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092338"]]
205
+  (29.0ms) commit transaction
206
+ Migrating to CreatePhotos (20150216092411)
207
+  (0.2ms) begin transaction
208
+  (0.9ms) CREATE 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) 
209
+  (0.6ms) CREATE INDEX "index_photos_on_photoable_id_and_photoable_type" ON "photos" ("photoable_id", "photoable_type")
210
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092411"]]
211
+  (36.3ms) commit transaction
212
+ Migrating to CreateContacts (20150216092449)
213
+  (0.2ms) begin transaction
214
+  (0.5ms) CREATE TABLE "contacts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
215
+  (0.2ms) CREATE INDEX "index_contacts_on_user_id" ON "contacts" ("user_id")
216
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092449"]]
217
+  (23.9ms) commit transaction
218
+ Migrating to CreateSsns (20150216092519)
219
+  (0.1ms) begin transaction
220
+  (0.4ms) CREATE TABLE "ssns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime) 
221
+  (0.2ms) CREATE INDEX "index_ssns_on_user_id" ON "ssns" ("user_id")
222
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092519"]]
223
+  (18.0ms) commit transaction
224
+ Migrating to CreateGeoLocations (20150220213422)
225
+  (0.2ms) begin transaction
226
+  (1.1ms) CREATE TABLE "geo_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
227
+  (0.7ms) CREATE INDEX "index_geo_locations_on_address_id" ON "geo_locations" ("address_id")
228
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
229
+  (12.7ms) commit transaction
230
+ Migrating to CreateSquishies (20150220230146)
231
+  (0.1ms) begin transaction
232
+  (1.0ms) CREATE 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) 
233
+  (0.4ms) CREATE INDEX "index_squishies_on_squishable_id_and_squishable_type" ON "squishies" ("squishable_id", "squishable_type")
234
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220230146"]]
235
+  (29.9ms) commit transaction
236
+ Migrating to CreateTires (20150301100658)
237
+  (0.1ms) begin transaction
238
+  (0.4ms) 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
+  (0.3ms) CREATE INDEX "index_tires_on_user_id" ON "tires" ("user_id")
240
+  (0.3ms) CREATE INDEX "index_tires_on_car_id" ON "tires" ("car_id")
241
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150301100658"]]
242
+  (20.0ms) commit transaction
243
+ Migrating to CreateCars (20150301100722)
244
+  (0.1ms) begin transaction
245
+  (0.8ms) CREATE TABLE "cars" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
246
+  (0.3ms) CREATE INDEX "index_cars_on_user_id" ON "cars" ("user_id")
247
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150301100722"]]
248
+  (26.4ms) commit transaction
249
+ Migrating to A (20150322233057)
250
+  (0.1ms) begin transaction
251
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233057"]]
252
+  (20.7ms) commit transaction
253
+ Migrating to B (20150322233103)
254
+  (0.1ms) begin transaction
255
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233103"]]
256
+  (17.0ms) commit transaction
257
+ Migrating to C (20150322233108)
258
+  (0.2ms) begin transaction
259
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233108"]]
260
+  (20.3ms) commit transaction
261
+ Migrating to D (20150322233117)
262
+  (0.1ms) begin transaction
263
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233117"]]
264
+  (21.8ms) commit transaction
265
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
266
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
267
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
268
+ Migrating to D (20150322233117)
269
+  (0.1ms) begin transaction
270
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233117'
271
+  (11.9ms) commit transaction
272
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
273
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
274
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
275
+ Migrating to C (20150322233108)
276
+  (0.1ms) begin transaction
277
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233108'
278
+  (18.9ms) commit transaction
279
+ Migrating to B (20150322233103)
280
+  (0.2ms) begin transaction
281
+ SQL (0.4ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233103'
282
+  (16.9ms) commit transaction
283
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
284
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
285
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
286
+ Migrating to A (20150322233057)
287
+  (0.1ms) begin transaction
288
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20150322233057'
289
+  (14.3ms) commit transaction
290
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
291
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
292
+ Migrating to CreateAlphas (20150322233720)
293
+  (0.1ms) begin transaction
294
+  (0.3ms) CREATE TABLE "alphas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "delta_id" integer, "created_at" datetime, "updated_at" datetime) 
295
+  (0.1ms) CREATE INDEX "index_alphas_on_delta_id" ON "alphas" ("delta_id")
296
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233720"]]
297
+  (13.2ms) commit transaction
298
+ Migrating to CreateBeta (20150322233733)
299
+  (0.2ms) begin transaction
300
+  (0.8ms) CREATE TABLE "beta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "alpha_id" integer, "created_at" datetime, "updated_at" datetime)
301
+  (0.6ms) CREATE INDEX "index_beta_on_alpha_id" ON "beta" ("alpha_id")
302
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233733"]]
303
+  (12.4ms) commit transaction
304
+ Migrating to CreateCapas (20150322233743)
305
+  (0.2ms) begin transaction
306
+  (0.9ms) CREATE TABLE "capas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "beta_id" integer, "created_at" datetime, "updated_at" datetime) 
307
+  (0.4ms) CREATE INDEX "index_capas_on_beta_id" ON "capas" ("beta_id")
308
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233743"]]
309
+  (12.9ms) commit transaction
310
+ Migrating to CreateDelta (20150322233755)
311
+  (0.1ms) begin transaction
312
+  (0.6ms) CREATE TABLE "delta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "capa_id" integer, "created_at" datetime, "updated_at" datetime)
313
+  (0.4ms) CREATE INDEX "index_delta_on_capa_id" ON "delta" ("capa_id")
314
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233755"]]
315
+  (12.5ms) commit transaction
316
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"