has_many_polymorphs 2.10 → 2.11
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +2 -0
- data/Manifest +191 -56
- data/TODO +1 -0
- data/examples/hmph.rb +69 -0
- data/generators/commenting/commenting_generator.rb +94 -0
- data/generators/commenting/templates/comment.rb +33 -0
- data/generators/commenting/templates/comment_test.rb +12 -0
- data/generators/commenting/templates/commenting.rb +13 -0
- data/generators/commenting/templates/commenting_extensions.rb +30 -0
- data/generators/commenting/templates/commenting_test.rb +30 -0
- data/generators/commenting/templates/commentings.yml +23 -0
- data/generators/commenting/templates/comments.yml +13 -0
- data/generators/commenting/templates/migration.rb +28 -0
- data/generators/tagging/templates/tagging_extensions.rb +4 -8
- data/has_many_polymorphs.gemspec +19 -12
- data/lib/has_many_polymorphs.rb +3 -4
- data/lib/has_many_polymorphs/autoload.rb +4 -4
- data/lib/has_many_polymorphs/class_methods.rb +8 -8
- data/lib/has_many_polymorphs/debugging_tools.rb +2 -0
- data/lib/has_many_polymorphs/dependencies.rb +9 -4
- data/lib/has_many_polymorphs/support_methods.rb +3 -1
- data/test/fixtures/{aquatic/fish.yml → fish.yml} +0 -0
- data/test/fixtures/{aquatic/little_whale_pupils.yml → little_whale_pupils.yml} +0 -0
- data/test/fixtures/{aquatic/whales.yml → whales.yml} +0 -0
- data/test/integration/app/README +182 -0
- data/test/integration/app/Rakefile +19 -0
- data/test/integration/app/app/controllers/addresses_controller.rb +85 -0
- data/test/integration/app/app/controllers/application.rb +7 -0
- data/test/integration/app/app/controllers/sellers_controller.rb +85 -0
- data/test/integration/app/app/controllers/states_controller.rb +85 -0
- data/test/integration/app/app/controllers/users_controller.rb +85 -0
- data/test/integration/app/app/helpers/addresses_helper.rb +2 -0
- data/test/integration/app/app/helpers/application_helper.rb +3 -0
- data/test/integration/app/app/helpers/sellers_helper.rb +28 -0
- data/test/integration/app/app/helpers/states_helper.rb +2 -0
- data/test/integration/app/app/helpers/users_helper.rb +2 -0
- data/test/integration/app/app/models/address.rb +4 -0
- data/test/integration/app/app/models/citation.rb +3 -0
- data/test/integration/app/app/models/citations_item.rb +4 -0
- data/test/integration/app/app/models/seller.rb +4 -0
- data/test/integration/app/app/models/state.rb +3 -0
- data/test/integration/app/app/models/user.rb +4 -0
- data/test/integration/app/app/views/addresses/edit.html.erb +12 -0
- data/test/integration/app/app/views/addresses/index.html.erb +18 -0
- data/test/integration/app/app/views/addresses/new.html.erb +11 -0
- data/test/integration/app/app/views/addresses/show.html.erb +3 -0
- data/test/integration/app/app/views/layouts/addresses.html.erb +17 -0
- data/test/integration/app/app/views/layouts/sellers.html.erb +17 -0
- data/test/integration/app/app/views/layouts/states.html.erb +17 -0
- data/test/integration/app/app/views/layouts/users.html.erb +17 -0
- data/test/integration/app/app/views/sellers/edit.html.erb +12 -0
- data/test/integration/app/app/views/sellers/index.html.erb +20 -0
- data/test/integration/app/app/views/sellers/new.html.erb +11 -0
- data/test/integration/app/app/views/sellers/show.html.erb +3 -0
- data/test/integration/app/app/views/states/edit.html.erb +12 -0
- data/test/integration/app/app/views/states/index.html.erb +19 -0
- data/test/integration/app/app/views/states/new.html.erb +11 -0
- data/test/integration/app/app/views/states/show.html.erb +3 -0
- data/test/integration/app/app/views/users/edit.html.erb +12 -0
- data/test/integration/app/app/views/users/index.html.erb +22 -0
- data/test/integration/app/app/views/users/new.html.erb +11 -0
- data/test/integration/app/app/views/users/show.html.erb +3 -0
- data/test/integration/app/config/boot.rb +45 -0
- data/test/integration/app/config/database.yml +21 -0
- data/test/integration/app/config/environment.rb +13 -0
- data/test/integration/app/config/environments/development.rb +7 -0
- data/test/integration/app/config/environments/production.rb +18 -0
- data/test/integration/app/config/environments/test.rb +19 -0
- data/test/integration/app/config/locomotive.yml +6 -0
- data/test/integration/app/config/routes.rb +33 -0
- data/test/integration/app/config/ultrasphinx/default.base +56 -0
- data/test/integration/app/config/ultrasphinx/development.conf.canonical +155 -0
- data/test/integration/app/db/migrate/001_create_users.rb +16 -0
- data/test/integration/app/db/migrate/002_create_sellers.rb +14 -0
- data/test/integration/app/db/migrate/003_create_addresses.rb +19 -0
- data/test/integration/app/db/migrate/004_create_states.rb +12 -0
- data/test/integration/app/db/migrate/005_add_capitalization_to_seller.rb +9 -0
- data/test/integration/app/db/migrate/006_add_deleted_to_user.rb +9 -0
- data/test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb +11 -0
- data/test/integration/app/db/migrate/008_create_citations.rb +12 -0
- data/test/integration/app/db/migrate/009_create_citations_items.rb +14 -0
- data/test/integration/app/db/schema.rb +144 -0
- data/test/integration/app/doc/README_FOR_APP +2 -0
- data/test/integration/app/generated_models/aquatic_fish.rb +109 -0
- data/test/integration/app/generated_models/aquatic_pupils_whale.rb +13 -0
- data/test/integration/app/generated_models/aquatic_whale.rb +42 -0
- data/test/integration/app/generated_models/beautiful_fight_relationship.rb +25 -0
- data/test/integration/app/generated_models/citation.rb +40 -0
- data/test/integration/app/generated_models/citations_item.rb +12 -0
- data/test/integration/app/generated_models/dog.rb +183 -0
- data/test/integration/app/generated_models/eaters_foodstuff.rb +13 -0
- data/test/integration/app/generated_models/frog.rb +78 -0
- data/test/integration/app/generated_models/kitten.rb +161 -0
- data/test/integration/app/generated_models/parentship.rb +14 -0
- data/test/integration/app/generated_models/person.rb +53 -0
- data/test/integration/app/generated_models/petfood.rb +125 -0
- data/test/integration/app/generated_models/polymorph_test_some_model.rb +25 -0
- data/test/integration/app/generated_models/seller.rb +30 -0
- data/test/integration/app/generated_models/tabby.rb +26 -0
- data/test/integration/app/generated_models/user.rb +34 -0
- data/test/integration/app/generated_models/wild_boar.rb +87 -0
- data/test/integration/app/generators/commenting_generator_test.rb +83 -0
- data/test/integration/app/public/404.html +30 -0
- data/test/integration/app/public/500.html +30 -0
- data/test/integration/app/public/dispatch.cgi +10 -0
- data/test/integration/app/public/dispatch.fcgi +24 -0
- data/test/integration/app/public/dispatch.rb +10 -0
- data/test/integration/app/public/favicon.ico +0 -0
- data/test/integration/app/public/images/rails.png +0 -0
- data/test/integration/app/public/index.html +277 -0
- data/test/integration/app/public/javascripts/application.js +2 -0
- data/test/integration/app/public/javascripts/controls.js +833 -0
- data/test/integration/app/public/javascripts/dragdrop.js +942 -0
- data/test/integration/app/public/javascripts/effects.js +1088 -0
- data/test/integration/app/public/javascripts/prototype.js +2515 -0
- data/test/integration/app/public/robots.txt +1 -0
- data/test/integration/app/public/stylesheets/scaffold.css +74 -0
- data/test/integration/app/script/about +3 -0
- data/test/integration/app/script/breakpointer +3 -0
- data/test/integration/app/script/console +3 -0
- data/test/integration/app/script/destroy +3 -0
- data/test/integration/app/script/generate +3 -0
- data/test/integration/app/script/performance/benchmarker +3 -0
- data/test/integration/app/script/performance/profiler +3 -0
- data/test/integration/app/script/plugin +3 -0
- data/test/integration/app/script/process/inspector +3 -0
- data/test/integration/app/script/process/reaper +3 -0
- data/test/integration/app/script/process/spawner +3 -0
- data/test/integration/app/script/runner +3 -0
- data/test/integration/app/script/server +3 -0
- data/test/integration/app/test/fixtures/addresses.yml +13 -0
- data/test/integration/app/test/fixtures/citations.yml +9 -0
- data/test/integration/app/test/fixtures/citations_items.yml +9 -0
- data/test/integration/app/test/fixtures/sellers.yml +10 -0
- data/test/integration/app/test/fixtures/states.yml +216 -0
- data/test/integration/app/test/fixtures/users.yml +11 -0
- data/test/integration/app/test/functional/addresses_controller_test.rb +57 -0
- data/test/integration/app/test/functional/sellers_controller_test.rb +57 -0
- data/test/integration/app/test/functional/states_controller_test.rb +57 -0
- data/test/integration/app/test/functional/users_controller_test.rb +57 -0
- data/test/integration/app/test/test_helper.rb +28 -0
- data/test/integration/app/test/unit/address_test.rb +10 -0
- data/test/integration/app/test/unit/citation_test.rb +10 -0
- data/test/integration/app/test/unit/citations_item_test.rb +10 -0
- data/test/integration/app/test/unit/seller_test.rb +10 -0
- data/test/integration/app/test/unit/state_test.rb +10 -0
- data/test/integration/app/test/unit/user_test.rb +10 -0
- data/test/models/aquatic/fish.rb +2 -1
- data/test/models/aquatic/whale.rb +2 -0
- data/test/setup.rb +10 -0
- data/test/test_all.rb +16 -0
- data/test/test_helper.rb +16 -12
- data/test/unit/polymorph_test.rb +35 -34
- metadata +239 -98
- metadata.gz.sig +0 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
#
|
2
|
+
# Sphinx/Ultrasphinx user-configurable options.
|
3
|
+
#
|
4
|
+
# Copy this file to RAILS_ROOT/config/ultrasphinx.
|
5
|
+
# You can use individual namespaces if you want (e.g. "development.base").
|
6
|
+
#
|
7
|
+
|
8
|
+
indexer
|
9
|
+
{
|
10
|
+
# Indexer running options
|
11
|
+
mem_limit = 256M
|
12
|
+
}
|
13
|
+
|
14
|
+
searchd
|
15
|
+
{
|
16
|
+
# Daemon options
|
17
|
+
# What interface the search daemon should listen on and where to store its logs
|
18
|
+
address = 0.0.0.0
|
19
|
+
port = 3313
|
20
|
+
log = /tmp/sphinx/searchd.log
|
21
|
+
query_log = /tmp/sphinx/query.log
|
22
|
+
read_timeout = 5
|
23
|
+
max_children = 300
|
24
|
+
pid_file = /tmp/sphinx/searchd.pid
|
25
|
+
max_matches = 100000
|
26
|
+
}
|
27
|
+
|
28
|
+
client
|
29
|
+
{
|
30
|
+
# Client options
|
31
|
+
dictionary_name = ts
|
32
|
+
# How your application connects to the search daemon (not necessarily the same as above)
|
33
|
+
server_host = localhost
|
34
|
+
server_port = 3313
|
35
|
+
}
|
36
|
+
|
37
|
+
source
|
38
|
+
{
|
39
|
+
# Individual SQL source options
|
40
|
+
sql_range_step = 20000
|
41
|
+
strip_html = 0
|
42
|
+
index_html_attrs =
|
43
|
+
sql_query_post =
|
44
|
+
}
|
45
|
+
|
46
|
+
index
|
47
|
+
{
|
48
|
+
# Index building options
|
49
|
+
path = /tmp/sphinx/
|
50
|
+
docinfo = extern # just leave this alone
|
51
|
+
morphology = stem_en
|
52
|
+
stopwords = # /path/to/stopwords.txt
|
53
|
+
min_word_len = 1
|
54
|
+
charset_type = utf-8 # or sbcs (Single Byte Character Set)
|
55
|
+
charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
|
56
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
|
2
|
+
# Auto-generated at Wed Oct 03 03:57:12 -0400 2007.
|
3
|
+
# Hand modifications will be overwritten.
|
4
|
+
# /Users/eweaver/Desktop/projects/chow/vendor/plugins/ultrasphinx/test/integration/app/config/ultrasphinx/default.base
|
5
|
+
indexer {
|
6
|
+
mem_limit = 256M
|
7
|
+
}
|
8
|
+
searchd {
|
9
|
+
read_timeout = 5
|
10
|
+
max_children = 300
|
11
|
+
log = /tmp/sphinx/searchd.log
|
12
|
+
port = 3313
|
13
|
+
max_matches = 100000
|
14
|
+
query_log = /tmp/sphinx/query.log
|
15
|
+
pid_file = /tmp/sphinx/searchd.pid
|
16
|
+
address = 0.0.0.0
|
17
|
+
}
|
18
|
+
|
19
|
+
# Source configuration
|
20
|
+
|
21
|
+
source geo__states
|
22
|
+
{
|
23
|
+
strip_html = 0
|
24
|
+
sql_range_step = 20000
|
25
|
+
index_html_attrs =
|
26
|
+
sql_query_post =
|
27
|
+
|
28
|
+
type = mysql
|
29
|
+
sql_query_pre = SET SESSION group_concat_max_len = 65535
|
30
|
+
sql_query_pre = SET NAMES utf8
|
31
|
+
|
32
|
+
sql_db = app_development
|
33
|
+
sql_host = localhost
|
34
|
+
sql_pass =
|
35
|
+
sql_user = root
|
36
|
+
sql_query_range = SELECT MIN(id), MAX(id) FROM states
|
37
|
+
sql_query = SELECT (states.id * 4 + 0) AS id, CAST(GROUP_CONCAT(addresses.name SEPARATOR ' ') AS CHAR) AS address_name, 0 AS capitalization, 'Geo::State' AS class, 0 AS class_id, '' AS company, '' AS company_name, 0 AS company_name_facet, '' AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, '' AS name, '' AS state, 0 AS user_id FROM states LEFT OUTER JOIN addresses ON states.id = addresses.state_id WHERE states.id >= $start AND states.id <= $end GROUP BY id
|
38
|
+
|
39
|
+
sql_group_column = capitalization
|
40
|
+
sql_group_column = class_id
|
41
|
+
sql_group_column = company_name_facet
|
42
|
+
sql_date_column = created_at
|
43
|
+
sql_group_column = deleted
|
44
|
+
sql_group_column = user_id
|
45
|
+
sql_query_info = SELECT * FROM states WHERE states.id = (($id - 0) / 4)
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
# Source configuration
|
50
|
+
|
51
|
+
source sellers
|
52
|
+
{
|
53
|
+
strip_html = 0
|
54
|
+
sql_range_step = 20000
|
55
|
+
index_html_attrs =
|
56
|
+
sql_query_post =
|
57
|
+
|
58
|
+
type = mysql
|
59
|
+
sql_query_pre = SET SESSION group_concat_max_len = 65535
|
60
|
+
sql_query_pre = SET NAMES utf8
|
61
|
+
|
62
|
+
sql_db = app_development
|
63
|
+
sql_host = localhost
|
64
|
+
sql_pass =
|
65
|
+
sql_user = root
|
66
|
+
sql_query_range = SELECT MIN(id), MAX(id) FROM sellers
|
67
|
+
sql_query = SELECT (sellers.id * 4 + 1) AS id, '' AS address_name, sellers.capitalization AS capitalization, 'Seller' AS class, 1 AS class_id, '' AS company, sellers.company_name AS company_name, CRC32(sellers.company_name) AS company_name_facet, '' AS content, UNIX_TIMESTAMP(sellers.created_at) AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, '' AS name, '' AS state, sellers.user_id AS user_id FROM sellers WHERE sellers.id >= $start AND sellers.id <= $end GROUP BY id
|
68
|
+
|
69
|
+
sql_group_column = capitalization
|
70
|
+
sql_group_column = class_id
|
71
|
+
sql_group_column = company_name_facet
|
72
|
+
sql_date_column = created_at
|
73
|
+
sql_group_column = deleted
|
74
|
+
sql_group_column = user_id
|
75
|
+
sql_query_info = SELECT * FROM sellers WHERE sellers.id = (($id - 1) / 4)
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
# Source configuration
|
80
|
+
|
81
|
+
source geo__addresses
|
82
|
+
{
|
83
|
+
strip_html = 0
|
84
|
+
sql_range_step = 20000
|
85
|
+
index_html_attrs =
|
86
|
+
sql_query_post =
|
87
|
+
|
88
|
+
type = mysql
|
89
|
+
sql_query_pre = SET SESSION group_concat_max_len = 65535
|
90
|
+
sql_query_pre = SET NAMES utf8
|
91
|
+
|
92
|
+
sql_db = app_development
|
93
|
+
sql_host = localhost
|
94
|
+
sql_pass =
|
95
|
+
sql_user = root
|
96
|
+
sql_query_range = SELECT MIN(id), MAX(id) FROM addresses
|
97
|
+
sql_query = SELECT (addresses.id * 4 + 2) AS id, '' AS address_name, 0 AS capitalization, 'Geo::Address' AS class, 2 AS class_id, '' AS company, '' AS company_name, 0 AS company_name_facet, CONCAT_WS(' ', addresses.line_1, addresses.line_2, addresses.city, addresses.province_region, addresses.zip_postal_code) AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, addresses.name AS name, states.name AS state, 0 AS user_id FROM addresses LEFT OUTER JOIN states ON states.id = addresses.state_id WHERE addresses.id >= $start AND addresses.id <= $end GROUP BY id
|
98
|
+
|
99
|
+
sql_group_column = capitalization
|
100
|
+
sql_group_column = class_id
|
101
|
+
sql_group_column = company_name_facet
|
102
|
+
sql_date_column = created_at
|
103
|
+
sql_group_column = deleted
|
104
|
+
sql_group_column = user_id
|
105
|
+
sql_query_info = SELECT * FROM addresses WHERE addresses.id = (($id - 2) / 4)
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
# Source configuration
|
110
|
+
|
111
|
+
source users
|
112
|
+
{
|
113
|
+
strip_html = 0
|
114
|
+
sql_range_step = 20000
|
115
|
+
index_html_attrs =
|
116
|
+
sql_query_post =
|
117
|
+
|
118
|
+
type = mysql
|
119
|
+
sql_query_pre = SET SESSION group_concat_max_len = 65535
|
120
|
+
sql_query_pre = SET NAMES utf8
|
121
|
+
|
122
|
+
sql_db = app_development
|
123
|
+
sql_host = localhost
|
124
|
+
sql_pass =
|
125
|
+
sql_user = root
|
126
|
+
sql_query_range = SELECT MIN(id), MAX(id) FROM users
|
127
|
+
sql_query = SELECT (users.id * 4 + 3) AS id, '' AS address_name, 0 AS capitalization, 'User' AS class, 3 AS class_id, sellers.company_name AS company, '' AS company_name, 0 AS company_name_facet, '' AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, users.deleted AS deleted, users.email AS email, '__empty_searchable__' AS empty_searchable, users.login AS login, '' AS name, '' AS state, 0 AS user_id FROM users LEFT OUTER JOIN sellers ON users.id = sellers.user_id WHERE users.id >= $start AND users.id <= $end AND (deleted = 0) GROUP BY id
|
128
|
+
|
129
|
+
sql_group_column = capitalization
|
130
|
+
sql_group_column = class_id
|
131
|
+
sql_group_column = company_name_facet
|
132
|
+
sql_date_column = created_at
|
133
|
+
sql_group_column = deleted
|
134
|
+
sql_group_column = user_id
|
135
|
+
sql_query_info = SELECT * FROM users WHERE users.id = (($id - 3) / 4)
|
136
|
+
}
|
137
|
+
|
138
|
+
|
139
|
+
# Index configuration
|
140
|
+
|
141
|
+
index complete
|
142
|
+
{
|
143
|
+
source = geo__addresses
|
144
|
+
source = geo__states
|
145
|
+
source = sellers
|
146
|
+
source = users
|
147
|
+
charset_type = utf-8
|
148
|
+
charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
|
149
|
+
min_word_len = 1
|
150
|
+
stopwords =
|
151
|
+
path = /tmp/sphinx//sphinx_index_complete
|
152
|
+
docinfo = extern
|
153
|
+
morphology = stem_en
|
154
|
+
}
|
155
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "users", :force => true do |t|
|
4
|
+
t.string "login", :limit => 64, :default => "", :null => false
|
5
|
+
t.string "email", :default => "", :null => false
|
6
|
+
t.string "crypted_password", :limit => 64, :default => "", :null => false
|
7
|
+
t.string "salt", :limit => 64, :default => "", :null => false
|
8
|
+
t.datetime "created_at"
|
9
|
+
t.datetime "updated_at"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :users
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSellers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "sellers", :force => true do |t|
|
4
|
+
t.integer "user_id", :null => false
|
5
|
+
t.string "company_name"
|
6
|
+
t.datetime "created_at"
|
7
|
+
t.datetime "updated_at"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :sellers
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateAddresses < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "addresses", :force => true do |t|
|
4
|
+
t.integer "user_id", :null => false
|
5
|
+
t.string "name"
|
6
|
+
t.string "line_1", :default => "", :null => false
|
7
|
+
t.string "line_2"
|
8
|
+
t.string "city", :default => "", :null => false
|
9
|
+
t.integer "state_id", :null => false
|
10
|
+
t.string "province_region"
|
11
|
+
t.string "zip_postal_code"
|
12
|
+
t.integer "country_id", :null => false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table :addresses
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateStates < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "states", :force => true do |t|
|
4
|
+
t.string "name", :default => "", :null => false
|
5
|
+
t.string "abbreviation", :default => "", :null => false
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
drop_table "states"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateCitationsItems < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :citations_items do |t|
|
4
|
+
t.integer :citation_id, :null => false
|
5
|
+
t.integer :item_id, :null => false
|
6
|
+
t.string :item_type, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :citations_items
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
# This file is autogenerated. Instead of editing this file, please use the
|
2
|
+
# migrations feature of ActiveRecord to incrementally modify your database, and
|
3
|
+
# then regenerate this schema definition.
|
4
|
+
|
5
|
+
ActiveRecord::Schema.define(:version => 9) do
|
6
|
+
|
7
|
+
create_table "addresses", :force => true do |t|
|
8
|
+
t.integer "user_id", :null => false
|
9
|
+
t.string "name"
|
10
|
+
t.string "line_1", :default => "", :null => false
|
11
|
+
t.string "line_2"
|
12
|
+
t.string "city", :default => "", :null => false
|
13
|
+
t.integer "state_id", :null => false
|
14
|
+
t.string "province_region"
|
15
|
+
t.string "zip_postal_code"
|
16
|
+
t.integer "country_id", :null => false
|
17
|
+
t.float "lat"
|
18
|
+
t.float "long"
|
19
|
+
end
|
20
|
+
|
21
|
+
create_table "bow_wows", :force => true do |t|
|
22
|
+
t.string "name"
|
23
|
+
t.datetime "created_at", :null => false
|
24
|
+
t.datetime "updated_at", :null => false
|
25
|
+
end
|
26
|
+
|
27
|
+
create_table "cats", :force => true do |t|
|
28
|
+
t.string "name"
|
29
|
+
t.string "cat_type"
|
30
|
+
t.datetime "created_at", :null => false
|
31
|
+
t.datetime "updated_at", :null => false
|
32
|
+
end
|
33
|
+
|
34
|
+
create_table "citations", :force => true do |t|
|
35
|
+
t.string "name"
|
36
|
+
t.datetime "created_at"
|
37
|
+
t.datetime "updated_at"
|
38
|
+
end
|
39
|
+
|
40
|
+
create_table "citations_items", :force => true do |t|
|
41
|
+
t.integer "citation_id", :null => false
|
42
|
+
t.integer "item_id", :null => false
|
43
|
+
t.string "item_type", :default => "", :null => false
|
44
|
+
t.datetime "created_at"
|
45
|
+
t.datetime "updated_at"
|
46
|
+
end
|
47
|
+
|
48
|
+
create_table "eaters_foodstuffs", :force => true do |t|
|
49
|
+
t.integer "foodstuff_id"
|
50
|
+
t.integer "eater_id"
|
51
|
+
t.integer "some_attribute", :default => 0
|
52
|
+
t.string "eater_type"
|
53
|
+
t.datetime "created_at", :null => false
|
54
|
+
t.datetime "updated_at", :null => false
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table "fish", :force => true do |t|
|
58
|
+
t.string "name"
|
59
|
+
t.integer "speed"
|
60
|
+
t.datetime "created_at", :null => false
|
61
|
+
t.datetime "updated_at", :null => false
|
62
|
+
end
|
63
|
+
|
64
|
+
create_table "frogs", :force => true do |t|
|
65
|
+
t.string "name"
|
66
|
+
t.datetime "created_at", :null => false
|
67
|
+
t.datetime "updated_at", :null => false
|
68
|
+
end
|
69
|
+
|
70
|
+
create_table "keep_your_enemies_close", :force => true do |t|
|
71
|
+
t.integer "enemy_id"
|
72
|
+
t.string "enemy_type"
|
73
|
+
t.integer "protector_id"
|
74
|
+
t.string "protector_type"
|
75
|
+
t.datetime "created_at", :null => false
|
76
|
+
t.datetime "updated_at", :null => false
|
77
|
+
end
|
78
|
+
|
79
|
+
create_table "little_whale_pupils", :force => true do |t|
|
80
|
+
t.integer "whale_id"
|
81
|
+
t.integer "aquatic_pupil_id"
|
82
|
+
t.string "aquatic_pupil_type"
|
83
|
+
t.datetime "created_at", :null => false
|
84
|
+
t.datetime "updated_at", :null => false
|
85
|
+
end
|
86
|
+
|
87
|
+
create_table "parentships", :force => true do |t|
|
88
|
+
t.integer "parent_id"
|
89
|
+
t.string "child_type"
|
90
|
+
t.integer "kid_id"
|
91
|
+
t.datetime "created_at", :null => false
|
92
|
+
t.datetime "updated_at", :null => false
|
93
|
+
end
|
94
|
+
|
95
|
+
create_table "people", :force => true do |t|
|
96
|
+
t.string "name"
|
97
|
+
t.integer "age"
|
98
|
+
t.datetime "created_at", :null => false
|
99
|
+
t.datetime "updated_at", :null => false
|
100
|
+
end
|
101
|
+
|
102
|
+
create_table "petfoods", :id => false, :force => true do |t|
|
103
|
+
t.integer "the_petfood_primary_key", :null => false
|
104
|
+
t.string "name"
|
105
|
+
t.datetime "created_at", :null => false
|
106
|
+
t.datetime "updated_at", :null => false
|
107
|
+
end
|
108
|
+
|
109
|
+
create_table "sellers", :force => true do |t|
|
110
|
+
t.integer "user_id", :null => false
|
111
|
+
t.string "company_name"
|
112
|
+
t.datetime "created_at"
|
113
|
+
t.datetime "updated_at"
|
114
|
+
t.float "capitalization", :default => 0.0
|
115
|
+
end
|
116
|
+
|
117
|
+
create_table "states", :force => true do |t|
|
118
|
+
t.string "name", :default => "", :null => false
|
119
|
+
t.string "abbreviation", :default => "", :null => false
|
120
|
+
end
|
121
|
+
|
122
|
+
create_table "users", :force => true do |t|
|
123
|
+
t.string "login", :limit => 64, :default => "", :null => false
|
124
|
+
t.string "email", :default => "", :null => false
|
125
|
+
t.string "crypted_password", :limit => 64, :default => "", :null => false
|
126
|
+
t.string "salt", :limit => 64, :default => "", :null => false
|
127
|
+
t.datetime "created_at"
|
128
|
+
t.datetime "updated_at"
|
129
|
+
t.boolean "deleted", :default => false
|
130
|
+
end
|
131
|
+
|
132
|
+
create_table "whales", :force => true do |t|
|
133
|
+
t.string "name"
|
134
|
+
t.datetime "created_at", :null => false
|
135
|
+
t.datetime "updated_at", :null => false
|
136
|
+
end
|
137
|
+
|
138
|
+
create_table "wild_boars", :force => true do |t|
|
139
|
+
t.string "name"
|
140
|
+
t.datetime "created_at", :null => false
|
141
|
+
t.datetime "updated_at", :null => false
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|