misha-ar-octopus 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +46 -0
- data/.rubocop_todo.yml +56 -0
- data/.ruby-version +1 -0
- data/.travis.yml +18 -0
- data/Appraisals +16 -0
- data/Gemfile +4 -0
- data/README.mkdn +242 -0
- data/Rakefile +172 -0
- data/TODO.txt +7 -0
- data/ar-octopus.gemspec +42 -0
- data/gemfiles/rails32.gemfile +7 -0
- data/gemfiles/rails4.gemfile +7 -0
- data/gemfiles/rails41.gemfile +7 -0
- data/gemfiles/rails42.gemfile +7 -0
- data/init.rb +1 -0
- data/lib/ar-octopus.rb +1 -0
- data/lib/octopus.rb +181 -0
- data/lib/octopus/abstract_adapter.rb +35 -0
- data/lib/octopus/association.rb +13 -0
- data/lib/octopus/association_shard_tracking.rb +114 -0
- data/lib/octopus/collection_association.rb +11 -0
- data/lib/octopus/collection_proxy.rb +16 -0
- data/lib/octopus/exception.rb +4 -0
- data/lib/octopus/has_and_belongs_to_many_association.rb +9 -0
- data/lib/octopus/load_balancing.rb +4 -0
- data/lib/octopus/load_balancing/round_robin.rb +20 -0
- data/lib/octopus/log_subscriber.rb +22 -0
- data/lib/octopus/migration.rb +168 -0
- data/lib/octopus/model.rb +210 -0
- data/lib/octopus/persistence.rb +39 -0
- data/lib/octopus/proxy.rb +534 -0
- data/lib/octopus/railtie.rb +11 -0
- data/lib/octopus/relation_proxy.rb +35 -0
- data/lib/octopus/scope_proxy.rb +61 -0
- data/lib/octopus/shard_tracking.rb +41 -0
- data/lib/octopus/shard_tracking/attribute.rb +22 -0
- data/lib/octopus/shard_tracking/dynamic.rb +11 -0
- data/lib/octopus/singular_association.rb +9 -0
- data/lib/octopus/slave_group.rb +13 -0
- data/lib/octopus/version.rb +3 -0
- data/lib/tasks/octopus.rake +16 -0
- data/rails/init.rb +1 -0
- data/sample_app/.gitignore +4 -0
- data/sample_app/.rspec +1 -0
- data/sample_app/Gemfile +20 -0
- data/sample_app/README +3 -0
- data/sample_app/README.rdoc +261 -0
- data/sample_app/Rakefile +7 -0
- data/sample_app/app/assets/images/rails.png +0 -0
- data/sample_app/app/assets/javascripts/application.js +15 -0
- data/sample_app/app/assets/stylesheets/application.css +13 -0
- data/sample_app/app/controllers/application_controller.rb +4 -0
- data/sample_app/app/helpers/application_helper.rb +2 -0
- data/sample_app/app/mailers/.gitkeep +0 -0
- data/sample_app/app/models/.gitkeep +0 -0
- data/sample_app/app/models/item.rb +3 -0
- data/sample_app/app/models/user.rb +3 -0
- data/sample_app/app/views/layouts/application.html.erb +14 -0
- data/sample_app/autotest/discover.rb +2 -0
- data/sample_app/config.ru +4 -0
- data/sample_app/config/application.rb +62 -0
- data/sample_app/config/boot.rb +6 -0
- data/sample_app/config/cucumber.yml +8 -0
- data/sample_app/config/database.yml +28 -0
- data/sample_app/config/environment.rb +5 -0
- data/sample_app/config/environments/development.rb +37 -0
- data/sample_app/config/environments/production.rb +67 -0
- data/sample_app/config/environments/test.rb +37 -0
- data/sample_app/config/initializers/backtrace_silencers.rb +7 -0
- data/sample_app/config/initializers/inflections.rb +15 -0
- data/sample_app/config/initializers/mime_types.rb +5 -0
- data/sample_app/config/initializers/secret_token.rb +7 -0
- data/sample_app/config/initializers/session_store.rb +8 -0
- data/sample_app/config/initializers/wrap_parameters.rb +14 -0
- data/sample_app/config/locales/en.yml +5 -0
- data/sample_app/config/routes.rb +58 -0
- data/sample_app/config/shards.yml +28 -0
- data/sample_app/db/migrate/20100720172715_create_users.rb +15 -0
- data/sample_app/db/migrate/20100720172730_create_items.rb +16 -0
- data/sample_app/db/migrate/20100720210335_create_sample_users.rb +11 -0
- data/sample_app/db/schema.rb +29 -0
- data/sample_app/db/seeds.rb +16 -0
- data/sample_app/doc/README_FOR_APP +2 -0
- data/sample_app/features/migrate.feature +45 -0
- data/sample_app/features/seed.feature +15 -0
- data/sample_app/features/step_definitions/seeds_steps.rb +13 -0
- data/sample_app/features/step_definitions/web_steps.rb +218 -0
- data/sample_app/features/support/database.rb +13 -0
- data/sample_app/features/support/env.rb +57 -0
- data/sample_app/features/support/paths.rb +33 -0
- data/sample_app/lib/assets/.gitkeep +0 -0
- data/sample_app/lib/tasks/.gitkeep +0 -0
- data/sample_app/lib/tasks/cucumber.rake +64 -0
- data/sample_app/log/.gitkeep +0 -0
- data/sample_app/public/404.html +26 -0
- data/sample_app/public/422.html +26 -0
- data/sample_app/public/500.html +26 -0
- data/sample_app/public/favicon.ico +0 -0
- data/sample_app/public/images/rails.png +0 -0
- data/sample_app/public/index.html +279 -0
- data/sample_app/public/javascripts/application.js +2 -0
- data/sample_app/public/javascripts/controls.js +965 -0
- data/sample_app/public/javascripts/dragdrop.js +974 -0
- data/sample_app/public/javascripts/effects.js +1123 -0
- data/sample_app/public/javascripts/prototype.js +4874 -0
- data/sample_app/public/javascripts/rails.js +118 -0
- data/sample_app/public/robots.txt +5 -0
- data/sample_app/public/stylesheets/.gitkeep +0 -0
- data/sample_app/script/cucumber +10 -0
- data/sample_app/script/rails +6 -0
- data/sample_app/spec/models/item_spec.rb +5 -0
- data/sample_app/spec/models/user_spec.rb +5 -0
- data/sample_app/spec/spec_helper.rb +27 -0
- data/sample_app/vendor/assets/javascripts/.gitkeep +0 -0
- data/sample_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/sample_app/vendor/plugins/.gitkeep +0 -0
- data/spec/config/shards.yml +217 -0
- data/spec/migrations/10_create_users_using_replication.rb +9 -0
- data/spec/migrations/11_add_field_in_all_slaves.rb +11 -0
- data/spec/migrations/12_create_users_using_block.rb +23 -0
- data/spec/migrations/13_create_users_using_block_and_using.rb +15 -0
- data/spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb +11 -0
- data/spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb +9 -0
- data/spec/migrations/1_create_users_on_master.rb +9 -0
- data/spec/migrations/2_create_users_on_canada.rb +11 -0
- data/spec/migrations/3_create_users_on_both_shards.rb +11 -0
- data/spec/migrations/4_create_users_on_shards_of_a_group.rb +11 -0
- data/spec/migrations/5_create_users_on_multiples_groups.rb +11 -0
- data/spec/migrations/6_raise_exception_with_invalid_shard_name.rb +11 -0
- data/spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb +11 -0
- data/spec/migrations/8_raise_exception_with_invalid_group_name.rb +11 -0
- data/spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb +11 -0
- data/spec/octopus/association_shard_tracking_spec.rb +714 -0
- data/spec/octopus/collection_proxy_spec.rb +16 -0
- data/spec/octopus/log_subscriber_spec.rb +19 -0
- data/spec/octopus/migration_spec.rb +115 -0
- data/spec/octopus/model_spec.rb +693 -0
- data/spec/octopus/octopus_spec.rb +123 -0
- data/spec/octopus/proxy_spec.rb +307 -0
- data/spec/octopus/relation_proxy_spec.rb +93 -0
- data/spec/octopus/replicated_slave_grouped_spec.rb +91 -0
- data/spec/octopus/replication_spec.rb +137 -0
- data/spec/octopus/scope_proxy_spec.rb +63 -0
- data/spec/octopus/sharded_replicated_slave_grouped_spec.rb +55 -0
- data/spec/octopus/sharded_spec.rb +33 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/active_record/connection_adapters/modify_config_adapter.rb +15 -0
- data/spec/support/database_connection.rb +4 -0
- data/spec/support/database_models.rb +118 -0
- data/spec/support/octopus_helper.rb +55 -0
- data/spec/support/query_count.rb +17 -0
- data/spec/support/shared_contexts.rb +18 -0
- data/spec/tasks/octopus.rake_spec.rb +32 -0
- metadata +388 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
module OctopusHelper
|
2
|
+
def self.clean_all_shards(shards)
|
3
|
+
if shards.nil?
|
4
|
+
shards = BlankModel.using(:master).connection.instance_variable_get(:@shards).keys
|
5
|
+
end
|
6
|
+
|
7
|
+
shards.each do |shard_symbol|
|
8
|
+
%w(schema_migrations users clients cats items keyboards computers permissions_roles roles permissions assignments projects programmers yummy adverts).each do |tables|
|
9
|
+
BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{tables}")
|
10
|
+
end
|
11
|
+
|
12
|
+
if shard_symbol == 'alone_shard'
|
13
|
+
%w(mmorpg_players weapons skills).each do |table|
|
14
|
+
BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{table}")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.clean_connection_proxy
|
21
|
+
Thread.current['octopus.current_model'] = nil
|
22
|
+
Thread.current['octopus.current_shard'] = nil
|
23
|
+
Thread.current['octopus.current_group'] = nil
|
24
|
+
Thread.current['octopus.current_slave_group'] = nil
|
25
|
+
Thread.current['octopus.block'] = nil
|
26
|
+
Thread.current['octopus.last_current_shard'] = nil
|
27
|
+
|
28
|
+
ActiveRecord::Base.class_variable_set(:@@connection_proxy, nil)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.migrating_to_version(version, &_block)
|
32
|
+
migrations_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'migrations'))
|
33
|
+
|
34
|
+
begin
|
35
|
+
ActiveRecord::Migrator.run(:up, migrations_root, version)
|
36
|
+
yield
|
37
|
+
ensure
|
38
|
+
ActiveRecord::Migrator.run(:down, migrations_root, version)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.using_environment(environment, &_block)
|
43
|
+
self.octopus_env = environment.to_s
|
44
|
+
clean_connection_proxy
|
45
|
+
yield
|
46
|
+
ensure
|
47
|
+
self.octopus_env = 'octopus'
|
48
|
+
clean_connection_proxy
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.octopus_env=(env)
|
52
|
+
Octopus.instance_variable_set(:@config, nil)
|
53
|
+
Octopus.stub(:env).and_return(env)
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
class QueryCounter
|
3
|
+
attr_accessor :query_count
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@query_count = 0
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_proc
|
10
|
+
lambda(&method(:callback))
|
11
|
+
end
|
12
|
+
|
13
|
+
def callback(_name, _start, _finish, _message_id, values)
|
14
|
+
@query_count += 1 unless %w(CACHE SCHEMA).include?(values[:name])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
shared_context 'with query cache enabled' do
|
2
|
+
let!(:counter) { ActiveRecord::QueryCounter.new }
|
3
|
+
|
4
|
+
before(:each) do
|
5
|
+
ActiveRecord::Base.connection.enable_query_cache!
|
6
|
+
counter.query_count = 0
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
ActiveRecord::Base.connection.disable_query_cache!
|
11
|
+
end
|
12
|
+
|
13
|
+
around(:each) do |example|
|
14
|
+
active_support_subscribed(counter.to_proc, 'sql.active_record') do
|
15
|
+
example.run
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
describe 'octopus.rake' do
|
5
|
+
before do
|
6
|
+
load File.expand_path('../../../lib/tasks/octopus.rake', __FILE__)
|
7
|
+
Rake::Task.define_task(:environment)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe 'octopus:copy_schema_versions' do
|
11
|
+
class SchemaMigration < ActiveRecord::Base; end
|
12
|
+
|
13
|
+
before do
|
14
|
+
Rake::Task['octopus:copy_schema_versions'].reenable
|
15
|
+
|
16
|
+
path = File.expand_path('../../migrations', __FILE__)
|
17
|
+
ActiveRecord::Migrator.migrations_paths = [path]
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'assumes each shard migrated to the current master version' do
|
21
|
+
SchemaMigration.create(:version => 1)
|
22
|
+
SchemaMigration.create(:version => 2)
|
23
|
+
SchemaMigration.create(:version => 3)
|
24
|
+
|
25
|
+
Rake::Task['octopus:copy_schema_versions'].invoke
|
26
|
+
|
27
|
+
ActiveRecord::Base.connection.shard_names.each do |shard_name|
|
28
|
+
expect(Octopus.using(shard_name) { ActiveRecord::Migrator.get_all_versions }).to eq([1, 2, 3])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,388 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: misha-ar-octopus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thiago Pradi
|
8
|
+
- Mike Perham
|
9
|
+
- Gabriel Sobrinho
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2016-01-31 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activerecord
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 3.2.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: activesupport
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 3.2.0
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.2.0
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: appraisal
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.3.8
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.3.8
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: mysql2
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 0.3.18
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 0.3.18
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: pg
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.11.0
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.11.0
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rake
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 0.8.7
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 0.8.7
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: rspec
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '3'
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '3'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: rubocop
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: sqlite3
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.3.4
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 1.3.4
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: pry-byebug
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
description: This gem allows you to use sharded databases with ActiveRecord. This
|
156
|
+
also provides a interface for replication and for running migrations with multiples
|
157
|
+
shards.
|
158
|
+
email:
|
159
|
+
- tchandy@gmail.com
|
160
|
+
- mperham@gmail.com
|
161
|
+
- gabriel.sobrinho@gmail.com
|
162
|
+
executables: []
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- ".gitignore"
|
167
|
+
- ".rspec"
|
168
|
+
- ".rubocop.yml"
|
169
|
+
- ".rubocop_todo.yml"
|
170
|
+
- ".ruby-version"
|
171
|
+
- ".travis.yml"
|
172
|
+
- Appraisals
|
173
|
+
- Gemfile
|
174
|
+
- README.mkdn
|
175
|
+
- Rakefile
|
176
|
+
- TODO.txt
|
177
|
+
- ar-octopus.gemspec
|
178
|
+
- gemfiles/rails32.gemfile
|
179
|
+
- gemfiles/rails4.gemfile
|
180
|
+
- gemfiles/rails41.gemfile
|
181
|
+
- gemfiles/rails42.gemfile
|
182
|
+
- init.rb
|
183
|
+
- lib/ar-octopus.rb
|
184
|
+
- lib/octopus.rb
|
185
|
+
- lib/octopus/abstract_adapter.rb
|
186
|
+
- lib/octopus/association.rb
|
187
|
+
- lib/octopus/association_shard_tracking.rb
|
188
|
+
- lib/octopus/collection_association.rb
|
189
|
+
- lib/octopus/collection_proxy.rb
|
190
|
+
- lib/octopus/exception.rb
|
191
|
+
- lib/octopus/has_and_belongs_to_many_association.rb
|
192
|
+
- lib/octopus/load_balancing.rb
|
193
|
+
- lib/octopus/load_balancing/round_robin.rb
|
194
|
+
- lib/octopus/log_subscriber.rb
|
195
|
+
- lib/octopus/migration.rb
|
196
|
+
- lib/octopus/model.rb
|
197
|
+
- lib/octopus/persistence.rb
|
198
|
+
- lib/octopus/proxy.rb
|
199
|
+
- lib/octopus/railtie.rb
|
200
|
+
- lib/octopus/relation_proxy.rb
|
201
|
+
- lib/octopus/scope_proxy.rb
|
202
|
+
- lib/octopus/shard_tracking.rb
|
203
|
+
- lib/octopus/shard_tracking/attribute.rb
|
204
|
+
- lib/octopus/shard_tracking/dynamic.rb
|
205
|
+
- lib/octopus/singular_association.rb
|
206
|
+
- lib/octopus/slave_group.rb
|
207
|
+
- lib/octopus/version.rb
|
208
|
+
- lib/tasks/octopus.rake
|
209
|
+
- rails/init.rb
|
210
|
+
- sample_app/.gitignore
|
211
|
+
- sample_app/.rspec
|
212
|
+
- sample_app/Gemfile
|
213
|
+
- sample_app/Gemfile.lock
|
214
|
+
- sample_app/README
|
215
|
+
- sample_app/README.rdoc
|
216
|
+
- sample_app/Rakefile
|
217
|
+
- sample_app/app/assets/images/rails.png
|
218
|
+
- sample_app/app/assets/javascripts/application.js
|
219
|
+
- sample_app/app/assets/stylesheets/application.css
|
220
|
+
- sample_app/app/controllers/application_controller.rb
|
221
|
+
- sample_app/app/helpers/application_helper.rb
|
222
|
+
- sample_app/app/mailers/.gitkeep
|
223
|
+
- sample_app/app/models/.gitkeep
|
224
|
+
- sample_app/app/models/item.rb
|
225
|
+
- sample_app/app/models/user.rb
|
226
|
+
- sample_app/app/views/layouts/application.html.erb
|
227
|
+
- sample_app/autotest/discover.rb
|
228
|
+
- sample_app/config.ru
|
229
|
+
- sample_app/config/application.rb
|
230
|
+
- sample_app/config/boot.rb
|
231
|
+
- sample_app/config/cucumber.yml
|
232
|
+
- sample_app/config/database.yml
|
233
|
+
- sample_app/config/environment.rb
|
234
|
+
- sample_app/config/environments/development.rb
|
235
|
+
- sample_app/config/environments/production.rb
|
236
|
+
- sample_app/config/environments/test.rb
|
237
|
+
- sample_app/config/initializers/backtrace_silencers.rb
|
238
|
+
- sample_app/config/initializers/inflections.rb
|
239
|
+
- sample_app/config/initializers/mime_types.rb
|
240
|
+
- sample_app/config/initializers/secret_token.rb
|
241
|
+
- sample_app/config/initializers/session_store.rb
|
242
|
+
- sample_app/config/initializers/wrap_parameters.rb
|
243
|
+
- sample_app/config/locales/en.yml
|
244
|
+
- sample_app/config/routes.rb
|
245
|
+
- sample_app/config/shards.yml
|
246
|
+
- sample_app/db/migrate/20100720172715_create_users.rb
|
247
|
+
- sample_app/db/migrate/20100720172730_create_items.rb
|
248
|
+
- sample_app/db/migrate/20100720210335_create_sample_users.rb
|
249
|
+
- sample_app/db/schema.rb
|
250
|
+
- sample_app/db/seeds.rb
|
251
|
+
- sample_app/doc/README_FOR_APP
|
252
|
+
- sample_app/features/migrate.feature
|
253
|
+
- sample_app/features/seed.feature
|
254
|
+
- sample_app/features/step_definitions/seeds_steps.rb
|
255
|
+
- sample_app/features/step_definitions/web_steps.rb
|
256
|
+
- sample_app/features/support/database.rb
|
257
|
+
- sample_app/features/support/env.rb
|
258
|
+
- sample_app/features/support/paths.rb
|
259
|
+
- sample_app/lib/assets/.gitkeep
|
260
|
+
- sample_app/lib/tasks/.gitkeep
|
261
|
+
- sample_app/lib/tasks/cucumber.rake
|
262
|
+
- sample_app/log/.gitkeep
|
263
|
+
- sample_app/public/404.html
|
264
|
+
- sample_app/public/422.html
|
265
|
+
- sample_app/public/500.html
|
266
|
+
- sample_app/public/favicon.ico
|
267
|
+
- sample_app/public/images/rails.png
|
268
|
+
- sample_app/public/index.html
|
269
|
+
- sample_app/public/javascripts/application.js
|
270
|
+
- sample_app/public/javascripts/controls.js
|
271
|
+
- sample_app/public/javascripts/dragdrop.js
|
272
|
+
- sample_app/public/javascripts/effects.js
|
273
|
+
- sample_app/public/javascripts/prototype.js
|
274
|
+
- sample_app/public/javascripts/rails.js
|
275
|
+
- sample_app/public/robots.txt
|
276
|
+
- sample_app/public/stylesheets/.gitkeep
|
277
|
+
- sample_app/script/cucumber
|
278
|
+
- sample_app/script/rails
|
279
|
+
- sample_app/spec/models/item_spec.rb
|
280
|
+
- sample_app/spec/models/user_spec.rb
|
281
|
+
- sample_app/spec/spec_helper.rb
|
282
|
+
- sample_app/vendor/assets/javascripts/.gitkeep
|
283
|
+
- sample_app/vendor/assets/stylesheets/.gitkeep
|
284
|
+
- sample_app/vendor/plugins/.gitkeep
|
285
|
+
- spec/config/shards.yml
|
286
|
+
- spec/migrations/10_create_users_using_replication.rb
|
287
|
+
- spec/migrations/11_add_field_in_all_slaves.rb
|
288
|
+
- spec/migrations/12_create_users_using_block.rb
|
289
|
+
- spec/migrations/13_create_users_using_block_and_using.rb
|
290
|
+
- spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb
|
291
|
+
- spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb
|
292
|
+
- spec/migrations/1_create_users_on_master.rb
|
293
|
+
- spec/migrations/2_create_users_on_canada.rb
|
294
|
+
- spec/migrations/3_create_users_on_both_shards.rb
|
295
|
+
- spec/migrations/4_create_users_on_shards_of_a_group.rb
|
296
|
+
- spec/migrations/5_create_users_on_multiples_groups.rb
|
297
|
+
- spec/migrations/6_raise_exception_with_invalid_shard_name.rb
|
298
|
+
- spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
|
299
|
+
- spec/migrations/8_raise_exception_with_invalid_group_name.rb
|
300
|
+
- spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
|
301
|
+
- spec/octopus/association_shard_tracking_spec.rb
|
302
|
+
- spec/octopus/collection_proxy_spec.rb
|
303
|
+
- spec/octopus/log_subscriber_spec.rb
|
304
|
+
- spec/octopus/migration_spec.rb
|
305
|
+
- spec/octopus/model_spec.rb
|
306
|
+
- spec/octopus/octopus_spec.rb
|
307
|
+
- spec/octopus/proxy_spec.rb
|
308
|
+
- spec/octopus/relation_proxy_spec.rb
|
309
|
+
- spec/octopus/replicated_slave_grouped_spec.rb
|
310
|
+
- spec/octopus/replication_spec.rb
|
311
|
+
- spec/octopus/scope_proxy_spec.rb
|
312
|
+
- spec/octopus/sharded_replicated_slave_grouped_spec.rb
|
313
|
+
- spec/octopus/sharded_spec.rb
|
314
|
+
- spec/spec_helper.rb
|
315
|
+
- spec/support/active_record/connection_adapters/modify_config_adapter.rb
|
316
|
+
- spec/support/database_connection.rb
|
317
|
+
- spec/support/database_models.rb
|
318
|
+
- spec/support/octopus_helper.rb
|
319
|
+
- spec/support/query_count.rb
|
320
|
+
- spec/support/shared_contexts.rb
|
321
|
+
- spec/tasks/octopus.rake_spec.rb
|
322
|
+
homepage: https://github.com/tchandy/octopus
|
323
|
+
licenses:
|
324
|
+
- MIT
|
325
|
+
metadata: {}
|
326
|
+
post_install_message: |-
|
327
|
+
Important: If you are upgrading from < Octopus 0.5.0 you need to run:
|
328
|
+
$ rake octopus:copy_schema_versions
|
329
|
+
|
330
|
+
Octopus now stores schema version information in each shard and migrations will not work properly unless this task is invoked.
|
331
|
+
rdoc_options: []
|
332
|
+
require_paths:
|
333
|
+
- lib
|
334
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
335
|
+
requirements:
|
336
|
+
- - ">="
|
337
|
+
- !ruby/object:Gem::Version
|
338
|
+
version: '0'
|
339
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
|
+
requirements:
|
341
|
+
- - ">="
|
342
|
+
- !ruby/object:Gem::Version
|
343
|
+
version: '0'
|
344
|
+
requirements: []
|
345
|
+
rubyforge_project:
|
346
|
+
rubygems_version: 2.4.5
|
347
|
+
signing_key:
|
348
|
+
specification_version: 4
|
349
|
+
summary: Easy Database Sharding for ActiveRecord
|
350
|
+
test_files:
|
351
|
+
- spec/config/shards.yml
|
352
|
+
- spec/migrations/10_create_users_using_replication.rb
|
353
|
+
- spec/migrations/11_add_field_in_all_slaves.rb
|
354
|
+
- spec/migrations/12_create_users_using_block.rb
|
355
|
+
- spec/migrations/13_create_users_using_block_and_using.rb
|
356
|
+
- spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb
|
357
|
+
- spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb
|
358
|
+
- spec/migrations/1_create_users_on_master.rb
|
359
|
+
- spec/migrations/2_create_users_on_canada.rb
|
360
|
+
- spec/migrations/3_create_users_on_both_shards.rb
|
361
|
+
- spec/migrations/4_create_users_on_shards_of_a_group.rb
|
362
|
+
- spec/migrations/5_create_users_on_multiples_groups.rb
|
363
|
+
- spec/migrations/6_raise_exception_with_invalid_shard_name.rb
|
364
|
+
- spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb
|
365
|
+
- spec/migrations/8_raise_exception_with_invalid_group_name.rb
|
366
|
+
- spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb
|
367
|
+
- spec/octopus/association_shard_tracking_spec.rb
|
368
|
+
- spec/octopus/collection_proxy_spec.rb
|
369
|
+
- spec/octopus/log_subscriber_spec.rb
|
370
|
+
- spec/octopus/migration_spec.rb
|
371
|
+
- spec/octopus/model_spec.rb
|
372
|
+
- spec/octopus/octopus_spec.rb
|
373
|
+
- spec/octopus/proxy_spec.rb
|
374
|
+
- spec/octopus/relation_proxy_spec.rb
|
375
|
+
- spec/octopus/replicated_slave_grouped_spec.rb
|
376
|
+
- spec/octopus/replication_spec.rb
|
377
|
+
- spec/octopus/scope_proxy_spec.rb
|
378
|
+
- spec/octopus/sharded_replicated_slave_grouped_spec.rb
|
379
|
+
- spec/octopus/sharded_spec.rb
|
380
|
+
- spec/spec_helper.rb
|
381
|
+
- spec/support/active_record/connection_adapters/modify_config_adapter.rb
|
382
|
+
- spec/support/database_connection.rb
|
383
|
+
- spec/support/database_models.rb
|
384
|
+
- spec/support/octopus_helper.rb
|
385
|
+
- spec/support/query_count.rb
|
386
|
+
- spec/support/shared_contexts.rb
|
387
|
+
- spec/tasks/octopus.rake_spec.rb
|
388
|
+
has_rdoc:
|