poly_belongs_to 0.1.4 → 0.1.5
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 +9 -6
- data/lib/poly_belongs_to/dup.rb +16 -5
- data/lib/poly_belongs_to/poly_belongs_to.rb +4 -12
- data/lib/poly_belongs_to/version.rb +1 -1
- data/lib/poly_belongs_to.rb +0 -1
- data/test/dummy/app/models/address.rb +2 -0
- data/test/dummy/app/models/geo_location.rb +4 -0
- data/test/dummy/app/models/squishy.rb +3 -0
- data/test/dummy/db/migrate/20150220213422_create_geo_locations.rb +11 -0
- data/test/dummy/db/migrate/20150220230146_create_squishies.rb +10 -0
- data/test/dummy/db/schema.rb +20 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +116 -0
- data/test/dummy/log/test.log +17191 -0
- data/test/dup_test.rb +7 -6
- data/test/fixtures/geo_locations.yml +14 -0
- data/test/fixtures/squishies.yml +26 -0
- data/test/test_helper.rb +2 -3
- metadata +14 -11
- data/lib/poly_belongs_to/hierarchy.rb +0 -23
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 070f2956135ec77c1f784a3291f8aa3d0af97a4e
|
4
|
+
data.tar.gz: 6e8a8b16efb10063d55460b609d1239bc7f956cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74a9a9dd7082aa50375bb07fc488ecf5b7c02513f5a29c7aec2d3690aaa3d19551b85bf60b1b0a4d3b9fe16fa05d610584d5470e7c5456c4314b281c57e6bd0
|
7
|
+
data.tar.gz: a86708d178b640ab44c96514c192b4f335d0ad1c755c9d601105cff1de6ea1c101a04ff038ad59b438e27a3ee7d40db580c88b08102e1778c36f152ab356e4b6
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#PolyBelongsTo
|
2
2
|
[](http://badge.fury.io/rb/poly_belongs_to)
|
3
|
-
[](https://codeclimate.com/github/danielpclark/PolyBelongsTo)
|
4
3
|
[](https://travis-ci.org/danielpclark/PolyBelongsTo)
|
4
|
+
[](https://codeclimate.com/github/danielpclark/PolyBelongsTo)
|
5
5
|
|
6
6
|
A standard way to check belongs_to relations on any belongs_to Object and let you check your DB Objects polymorphism in a more across-the-board meta-programatically friendly way.
|
7
7
|
|
@@ -57,7 +57,7 @@ MyObject.first.pbt_parent
|
|
57
57
|
# => #<User id: 123 ... >
|
58
58
|
```
|
59
59
|
|
60
|
-
##Also
|
60
|
+
##Also Available
|
61
61
|
```ruby
|
62
62
|
# --- Model Instances ---
|
63
63
|
# NOTE: touches db if object isn't already instantiated
|
@@ -90,7 +90,7 @@ MyObject.new.pbt_type_sym # nil for non polymorphic Objects
|
|
90
90
|
##Internal Methods Available
|
91
91
|
|
92
92
|
```ruby
|
93
|
-
# For cleaning
|
93
|
+
# For cleaning attributes for use with build
|
94
94
|
PolyBelongsTo::Pbt::AttrSanitizer[ obj ]
|
95
95
|
|
96
96
|
# Returns string of either 'child.build' or 'build_child'
|
@@ -114,7 +114,9 @@ PolyBelongsTo::Pbt::IsSingular[ obj, child ]
|
|
114
114
|
# Returns true if obj->child relationship is has_many
|
115
115
|
PolyBelongsTo::Pbt::IsPlural[ obj, child ]
|
116
116
|
|
117
|
-
# Returns the
|
117
|
+
# Returns the symbol for the CollectionProxy the child belongs to in relation to obj
|
118
|
+
# NOTE: This returns a collection proxy for has_many.
|
119
|
+
# For has_one it's the object ref itself.
|
118
120
|
PolyBelongsTo::Pbt::CollectionProxy[ obj, child ]
|
119
121
|
|
120
122
|
```
|
@@ -130,8 +132,9 @@ know what's involved when using this. It's purposefully done this way to lead t
|
|
130
132
|
the documentation for PolyBelongsTo's duplication methods.
|
131
133
|
|
132
134
|
####Known Issues
|
133
|
-
- Carrierwave records won't duplicate. To ensure other records
|
134
|
-
rollback use .save(validate: false) ... I'm considering possible options
|
135
|
+
- Carrierwave records won't duplicate. To ensure that other records will still save and
|
136
|
+
prevent any rollback issues use .save(validate: false) ... I'm considering possible options
|
137
|
+
to remedy this and
|
135
138
|
other scenarios.
|
136
139
|
- For deep duplication you need to be very aware of the potential for infinite loops with
|
137
140
|
your records if there are any circular references.
|
data/lib/poly_belongs_to/dup.rb
CHANGED
@@ -16,14 +16,25 @@ module PolyBelongsTo
|
|
16
16
|
pbt_dup_build(item_to_build_on, item_to_duplicate)
|
17
17
|
PolyBelongsTo::Pbt::Reflects[item_to_duplicate].each do |ref|
|
18
18
|
child = eval("item_to_duplicate.#{ref}")
|
19
|
+
core = eval("item_to_build_on.#{PolyBelongsTo::Pbt::CollectionProxy[item_to_build_on, item_to_duplicate]}")
|
19
20
|
if child.respond_to?(:build)
|
20
|
-
child.each do |
|
21
|
-
|
22
|
-
|
21
|
+
child.each do |spawn|
|
22
|
+
if core.respond_to?(:build)
|
23
|
+
core.each do |subscore|
|
24
|
+
subscore.pbt_deep_dup_build(spawn)
|
25
|
+
end
|
26
|
+
else
|
27
|
+
core.pbt_deep_dup_build(spawn)
|
28
|
+
end
|
23
29
|
end
|
24
30
|
else
|
25
|
-
|
26
|
-
|
31
|
+
if core.respond_to?(:build)
|
32
|
+
core.each do |subcore|
|
33
|
+
subcore.pbt_deep_dup_build(child)
|
34
|
+
end
|
35
|
+
else
|
36
|
+
core.pbt_deep_dup_build(child)
|
37
|
+
end
|
27
38
|
end
|
28
39
|
end
|
29
40
|
item_to_build_on
|
@@ -40,27 +40,19 @@ module PolyBelongsTo
|
|
40
40
|
}
|
41
41
|
|
42
42
|
IsSingular = lambda {|obj, child|
|
43
|
-
|
44
|
-
map(&:name).map(&:to_sym).include? ActiveModel::Naming.singular(child).to_sym
|
43
|
+
SingularOrPlural[obj, child] == :singular
|
45
44
|
}
|
46
45
|
|
47
46
|
IsPlural = lambda {|obj,child|
|
48
|
-
|
49
|
-
map(&:name).map(&:to_sym).include? ActiveModel::Naming.plural(child).to_sym
|
47
|
+
SingularOrPlural[obj, child] == :plural
|
50
48
|
}
|
51
49
|
|
52
50
|
CollectionProxy = lambda {|obj, child|
|
53
51
|
reflects = Reflects[obj]
|
54
52
|
proxy = ActiveModel::Naming.singular(child).to_sym
|
55
|
-
if reflects.include? proxy
|
56
|
-
return proxy
|
57
|
-
end
|
53
|
+
return proxy if reflects.include? proxy
|
58
54
|
proxy = ActiveModel::Naming.plural(child).to_sym
|
59
|
-
|
60
|
-
proxy
|
61
|
-
else
|
62
|
-
nil
|
63
|
-
end
|
55
|
+
reflects.include?(proxy) ? proxy : nil
|
64
56
|
}
|
65
57
|
end
|
66
58
|
end
|
data/lib/poly_belongs_to.rb
CHANGED
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: 20150220230146) do
|
15
15
|
|
16
16
|
create_table "addresses", force: true do |t|
|
17
17
|
t.integer "addressable_id"
|
@@ -32,6 +32,15 @@ ActiveRecord::Schema.define(version: 20150216092519) do
|
|
32
32
|
|
33
33
|
add_index "contacts", ["user_id"], name: "index_contacts_on_user_id"
|
34
34
|
|
35
|
+
create_table "geo_locations", force: true do |t|
|
36
|
+
t.integer "address_id"
|
37
|
+
t.string "content"
|
38
|
+
t.datetime "created_at"
|
39
|
+
t.datetime "updated_at"
|
40
|
+
end
|
41
|
+
|
42
|
+
add_index "geo_locations", ["address_id"], name: "index_geo_locations_on_address_id"
|
43
|
+
|
35
44
|
create_table "phones", force: true do |t|
|
36
45
|
t.integer "phoneable_id"
|
37
46
|
t.string "phoneable_type"
|
@@ -62,6 +71,16 @@ ActiveRecord::Schema.define(version: 20150216092519) do
|
|
62
71
|
|
63
72
|
add_index "profiles", ["profileable_id", "profileable_type"], name: "index_profiles_on_profileable_id_and_profileable_type"
|
64
73
|
|
74
|
+
create_table "squishies", force: true do |t|
|
75
|
+
t.string "content"
|
76
|
+
t.integer "squishable_id"
|
77
|
+
t.string "squishable_type"
|
78
|
+
t.datetime "created_at"
|
79
|
+
t.datetime "updated_at"
|
80
|
+
end
|
81
|
+
|
82
|
+
add_index "squishies", ["squishable_id", "squishable_type"], name: "index_squishies_on_squishable_id_and_squishable_type"
|
83
|
+
|
65
84
|
create_table "ssns", force: true do |t|
|
66
85
|
t.integer "user_id"
|
67
86
|
t.string "content"
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -53,3 +53,119 @@ Migrating to CreateSsns (20150216092519)
|
|
53
53
|
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
54
54
|
[1m[36mUser Load (0.5ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
55
55
|
SQLite3::SQLException: no such table: users: SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
56
|
+
[1m[36m (26.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
57
|
+
[1m[35m (15.6ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
58
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
59
|
+
Migrating to CreateUsers (20150211224139)
|
60
|
+
[1m[35m (0.1ms)[0m begin transaction
|
61
|
+
[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
|
62
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224139"]]
|
63
|
+
[1m[36m (13.0ms)[0m [1mcommit transaction[0m
|
64
|
+
Migrating to CreateTags (20150211224157)
|
65
|
+
[1m[35m (0.1ms)[0m begin transaction
|
66
|
+
[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
|
67
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_tags_on_user_id" ON "tags" ("user_id")
|
68
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150211224157"]]
|
69
|
+
[1m[35m (17.4ms)[0m commit transaction
|
70
|
+
Migrating to CreatePhones (20150211224225)
|
71
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
72
|
+
[1m[35m (0.7ms)[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)
|
73
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_phones_on_phoneable_id_and_phoneable_type" ON "phones" ("phoneable_id", "phoneable_type")[0m
|
74
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224225"]]
|
75
|
+
[1m[36m (30.0ms)[0m [1mcommit transaction[0m
|
76
|
+
Migrating to CreateAddresses (20150216092218)
|
77
|
+
[1m[35m (0.1ms)[0m begin transaction
|
78
|
+
[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
|
79
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_addresses_on_addressable_id_and_addressable_type" ON "addresses" ("addressable_id", "addressable_type")
|
80
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092218"]]
|
81
|
+
[1m[35m (31.0ms)[0m commit transaction
|
82
|
+
Migrating to CreateProfiles (20150216092338)
|
83
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
84
|
+
[1m[35m (0.3ms)[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)
|
85
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_profiles_on_profileable_id_and_profileable_type" ON "profiles" ("profileable_id", "profileable_type")[0m
|
86
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092338"]]
|
87
|
+
[1m[36m (15.5ms)[0m [1mcommit transaction[0m
|
88
|
+
Migrating to CreatePhotos (20150216092411)
|
89
|
+
[1m[35m (0.1ms)[0m begin transaction
|
90
|
+
[1m[36m (0.3ms)[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
|
91
|
+
[1m[35m (0.2ms)[0m CREATE INDEX "index_photos_on_photoable_id_and_photoable_type" ON "photos" ("photoable_id", "photoable_type")
|
92
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092411"]]
|
93
|
+
[1m[35m (13.2ms)[0m commit transaction
|
94
|
+
Migrating to CreateContacts (20150216092449)
|
95
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
96
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "contacts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
97
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_contacts_on_user_id" ON "contacts" ("user_id")[0m
|
98
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092449"]]
|
99
|
+
[1m[36m (12.9ms)[0m [1mcommit transaction[0m
|
100
|
+
Migrating to CreateSsns (20150216092519)
|
101
|
+
[1m[35m (0.1ms)[0m begin transaction
|
102
|
+
[1m[36m (0.6ms)[0m [1mCREATE TABLE "ssns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
103
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_ssns_on_user_id" ON "ssns" ("user_id")
|
104
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092519"]]
|
105
|
+
[1m[35m (18.5ms)[0m commit transaction
|
106
|
+
Migrating to CreateGeoLocations (20150220213422)
|
107
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
108
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "geo_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
109
|
+
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_geo_locations_on_address_id" ON "geo_locations" ("address_id")[0m
|
110
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
|
111
|
+
[1m[36m (12.6ms)[0m [1mcommit transaction[0m
|
112
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
113
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
114
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
115
|
+
[1m[36m (17.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
116
|
+
[1m[35m (25.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
117
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
118
|
+
Migrating to CreateUsers (20150211224139)
|
119
|
+
[1m[35m (0.1ms)[0m begin transaction
|
120
|
+
[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
|
121
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224139"]]
|
122
|
+
[1m[36m (12.1ms)[0m [1mcommit transaction[0m
|
123
|
+
Migrating to CreateTags (20150211224157)
|
124
|
+
[1m[35m (0.1ms)[0m begin transaction
|
125
|
+
[1m[36m (0.4ms)[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
|
126
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_tags_on_user_id" ON "tags" ("user_id")
|
127
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150211224157"]]
|
128
|
+
[1m[35m (12.3ms)[0m commit transaction
|
129
|
+
Migrating to CreatePhones (20150211224225)
|
130
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
131
|
+
[1m[35m (0.5ms)[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)
|
132
|
+
[1m[36m (0.3ms)[0m [1mCREATE INDEX "index_phones_on_phoneable_id_and_phoneable_type" ON "phones" ("phoneable_id", "phoneable_type")[0m
|
133
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224225"]]
|
134
|
+
[1m[36m (12.1ms)[0m [1mcommit transaction[0m
|
135
|
+
Migrating to CreateAddresses (20150216092218)
|
136
|
+
[1m[35m (0.1ms)[0m begin transaction
|
137
|
+
[1m[36m (0.6ms)[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
|
138
|
+
[1m[35m (0.4ms)[0m CREATE INDEX "index_addresses_on_addressable_id_and_addressable_type" ON "addresses" ("addressable_id", "addressable_type")
|
139
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092218"]]
|
140
|
+
[1m[35m (12.5ms)[0m commit transaction
|
141
|
+
Migrating to CreateProfiles (20150216092338)
|
142
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
143
|
+
[1m[35m (0.6ms)[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)
|
144
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_profiles_on_profileable_id_and_profileable_type" ON "profiles" ("profileable_id", "profileable_type")[0m
|
145
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092338"]]
|
146
|
+
[1m[36m (12.4ms)[0m [1mcommit transaction[0m
|
147
|
+
Migrating to CreatePhotos (20150216092411)
|
148
|
+
[1m[35m (0.1ms)[0m begin transaction
|
149
|
+
[1m[36m (0.4ms)[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
|
150
|
+
[1m[35m (0.2ms)[0m CREATE INDEX "index_photos_on_photoable_id_and_photoable_type" ON "photos" ("photoable_id", "photoable_type")
|
151
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092411"]]
|
152
|
+
[1m[35m (12.6ms)[0m commit transaction
|
153
|
+
Migrating to CreateContacts (20150216092449)
|
154
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
155
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "contacts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
156
|
+
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_contacts_on_user_id" ON "contacts" ("user_id")[0m
|
157
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092449"]]
|
158
|
+
[1m[36m (18.4ms)[0m [1mcommit transaction[0m
|
159
|
+
Migrating to CreateSsns (20150216092519)
|
160
|
+
[1m[35m (0.2ms)[0m begin transaction
|
161
|
+
[1m[36m (0.6ms)[0m [1mCREATE TABLE "ssns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
162
|
+
[1m[35m (0.3ms)[0m CREATE INDEX "index_ssns_on_user_id" ON "ssns" ("user_id")
|
163
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150216092519"]]
|
164
|
+
[1m[35m (12.6ms)[0m commit transaction
|
165
|
+
Migrating to CreateGeoLocations (20150220213422)
|
166
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
167
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "geo_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address_id" integer, "content" varchar(255), "created_at" datetime, "updated_at" datetime)
|
168
|
+
[1m[36m (0.5ms)[0m [1mCREATE INDEX "index_geo_locations_on_address_id" ON "geo_locations" ("address_id")[0m
|
169
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
|
170
|
+
[1m[36m (13.0ms)[0m [1mcommit transaction[0m
|
171
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|