This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
/
CHANGES
250 lines (173 loc) · 10.4 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
1.9.1 (2014-11-14):
The project has been suspended. No updates will be provided and no Rails versions
beyond 3.2.x will be supported.
For more information please check out this blog post: http://kovyrin.net/2014/11/14/dbcharmer-suspended/
----------------------------------------------------------------------------------------
1.9.0 (2013-10-09):
Most of the major changes in this version are related to our initial push towards making
DbCharmer thread-safe and making sure it works correctly in multi-threaded environments.
Please note, that even though we now test DbCharmer in multi-threaded environments, we still
consider multi-threaded support experimental.
Bug fix: Improved Rails environment detection (sometimes DbCharmer would use
Rails-specific code while running in non-rails projects).
Bug fix: Make sure on_db() method could restore original connection after an exception is
raised from a DB driver during connection switching (Thanks to Dmytro Shteflyuk for finding
the issue and helping with debugging).
This is the first release that does not have a really strict constraint for point-releases
within the Rails 3.2.x branch.
----------------------------------------------------------------------------------------
1.8.4 (2013-03-18):
Bumped up rails dependencies up to 3.2.13.
----------------------------------------------------------------------------------------
1.8.3 (2013-02-11):
Bumped up rails dependencies up to 3.2.12.
----------------------------------------------------------------------------------------
1.8.2 (2013-01-11):
Bumped up rails dependencies up to 3.2.11.
----------------------------------------------------------------------------------------
1.8.1 (2013-01-02):
Bumped up rails dependencies up to 3.2.10.
----------------------------------------------------------------------------------------
1.8.0 (2012-11-12):
Added support for Rails versions up to 3.2.9. Please note, that Rails 3.2.4 is not officially
supported. Your code may work on that version, but no bug reports will be accepted about this
version.
Tests for DbCharmer have been moved to the gem repository to make Travis-CI integration more
stable. We do not put test files into the gem inself so it should not be a problem for most
of the users. If you still use db-charmer as a plugin, please switch to gem mode.
----------------------------------------------------------------------------------------
1.7.1 (2012-04-22):
Beta feature: Rails 3.1 and 3.2 support
Thanks to the community (and Eugene Pimenov aka @libc in particular) we now have support
for Rails versions up to 3.2.1, including new migrations classes.
----------------------------------------------------------------------------------------
1.7.0 (2011-08-29):
Beta feature: Rails 3 support
Beta feature: Added force_slave_reads functionality. Now we could have models with slaves
that are not used by default, but could be turned on globally (per-controller or per-action).
Heavily reorganized the source code to match Rails code structure (class names, etc). This should
make it much easier for other contributors to work with the code.
Added smarter environment detection (using Rails.env, RAILS_ENV or RACK_ENV).
Changed dependencies a bit: instead of depending on rails, we now require specific components
(ActiveRecord, ActiveSupport, etc) + we do not require blankslate gem anymore.
Bugfixes: Fix for N+1 queries when accessing shard_info for db_block_group_map sharding method.
----------------------------------------------------------------------------------------
1.6.17-19 (2011-04-25):
Bugfixes: Do not touch database for sharded models until we really need to. Before 1.6.17
if a database server was dead and there were any other connection issues, class loading
in Ruby would be broken and sharded model class would not be initialized.
----------------------------------------------------------------------------------------
1.6.14 (2011-01-09):
Bugfixes: We do not support Rails 3, and now we prohibit any versions but 2.2 and 2.3 from
being used with db-charmer gem.
----------------------------------------------------------------------------------------
1.6.13 (2010-08-17):
Starting with this version we use Rails.env instead of RAILS_ENV to auto-detect rails
environment. If you use DbCharmer in non-rails project, please set DbCharmer.env manually.
Bugfixes: Thanks to Eric Lindvall we now allow connection names that have symbols ruby
wouldn't like for class names.
----------------------------------------------------------------------------------------
1.6.12 (2010-05-09):
Starting with this version we use Rails.cache (memcache or whatever you use in your project)
to cache sharding blocks information.
Bugfixes: Thanks to Allen Madsen (github user blatyo) we've fixed a few minor issues in
database connections handling.
----------------------------------------------------------------------------------------
1.6.11 (2010-04-16):
Bugfix: Change the way we allocate sharding blocks in block map sharding method to
prevent race-conditions from happening on block to shard assignments.
Breaking change: We require connections to exist by default in all connection factory
methods. If you need old behavior, pass should_exist=false explicitly.
----------------------------------------------------------------------------------------
1.6.10 (2010-04-09):
Multi-Db migrations changed. Now it is possible to call ActiveRecord::Migration.db_magic
and specify default migration connection that would be used by all migrations without
excplicitly switched connections.
----------------------------------------------------------------------------------------
1.6.9 (2010-04-08):
Bugfix release: now DbCharmer works without Rails.
----------------------------------------------------------------------------------------
1.6.7 (2010-04-07):
Changed the way we handle associations in on_db(:foo).find(:include) calls. Now we
switch association's connection only if its default connection is the same as the
master model's connection (not more "table does not exist" problems I hope).
----------------------------------------------------------------------------------------
1.6.5 (2010-04-05):
Bugfix release: Fixed :connection vs :slave in db_magic behaviour. Model.on_master should
run queries on the master, not on AR's default connection.
----------------------------------------------------------------------------------------
1.6.4 (2010-04-05):
Default behaviour changed: DbCharmer.connections_should_exist is true in all environments
by default. Old default behaviour was too misleading for many developers.
----------------------------------------------------------------------------------------
1.6.3 (2010-04-03):
Bugfix release: Modified stub connection initialization code to set default connections
for sharded models using shards enumeration or default shard features of sharding methods.
----------------------------------------------------------------------------------------
1.6.2 (2010-04-03):
Bugfix release: Modified our stub connection used on sharded models to fail on db-calling
methods only. Proxy the rest to a real shard connection. Another bug fixed in db_block_map
sharding method: we didn't increment block counters when assigning blocks to shards.
----------------------------------------------------------------------------------------
1.6.1 (2010-03-31):
Breaking change from now on all connection-switching methods (both in migrations and in
models) are controlled by a single option DbCharmer.connections_should_exist. This
option is false by default in all non-production environments. Check out README for
more details.
----------------------------------------------------------------------------------------
1.6.0 (2010-03-31):
The major (and arguably the only noticeable) change in this version is our simple database
sharding support. The feature is still in alpha stage and should not be used in production
without complete understanding of the principles of its work.
----------------------------------------------------------------------------------------
1.5.5 (2010-03-15):
Thanks to ngmoco.com (http://github.com/ngmoco) now DbCharmer supports one more use-case
for multi-db migrations. Now you can run the same migration on many databases at once.
For example, the following migration would create test_table on all three shard databases:
class MultiDbTest < ActiveRecord::Migration
db_magic :connections => [ :shard01, :shard02, :shard03 ]
def self.up
create_table :test_table do |t|
t.string :test_string
t.timestamps
end
end
def self.down
drop_table :test_table
end
end
----------------------------------------------------------------------------------------
1.5.4 (2010-03-12):
Added DbCharmer.with_remapped_databases, so that you can change the connection for
many models simultaneously, and implicitly. Very useful for work where you want to use
a particular slave for a whole range of database access.
----------------------------------------------------------------------------------------
1.5.3 (2010-03-10):
Few changes:
* Colorized connection names in the logs for development mode
* We do not log connection names when connection does not exist
----------------------------------------------------------------------------------------
1.5.1 (2010-03-06):
In this version we've added support for connection names logging in Rails queries log.
New log records have [connection_name] prefix for all queries that are executed on
non-standard connections:
[logs] LogRecord Columns (1.1ms) SHOW FIELDS FROM `log_records`
[logs] User Delete all (0.1ms) DELETE FROM `users`
[slave01] User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`login` = 'foo')
----------------------------------------------------------------------------------------
1.4.6 -> 1.5.0 (2010-03-05):
Major change in this version of DbCharmer is association preload support. For example,
let's say we have a schema:
class Post < ActiveRecord::Base
belongs_to :user
end
class User < ActiveRecord::Base
has_many :posts
end
Now, if we have the following call in our code:
User.on_db(:foo).all(:include => :posts)
In 1.4.6 it would load the users from connection :foo and posts from the
default connection, which is not what we would expect from this line of code.
So, starting 1.5.0 all finder calls on models having :include parameter would
switch associated models' connections to the same connection as the main model
in the call.