schema_plus 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14f770e20ed8fc7090ddc3fd58e95976e6a6ae13
4
- data.tar.gz: 999f0ad6bd7a1346dda3ebc152ec2a0f7a430488
3
+ metadata.gz: 020e3e1c91dcc48f913fa638609354eb5a79e38b
4
+ data.tar.gz: f14c7627f58133d2f6471dadd5833b05e5ca5119
5
5
  SHA512:
6
- metadata.gz: 33fdfaee05d32853f87112adc5d156970f4d5bddec6c2f8379a283ad16cf6e9eb3e5adfb84dbf60af476e340f51c15ab6f53d2336877226e670602bbf141d35e
7
- data.tar.gz: 3ff056bfd48ea22a5004f3f6760d4bec52127bde7040b65082f2de86fcf00b1353be1a1f46a6b1d37dc04ab87ef0cb6f8146578d985cb126d118b77a670dc124
6
+ metadata.gz: 81abbdb298150d9b7939c4099c25d1f61ffab212e1aa98a8cd65f5fee4eb9254d960d1463883c0401ff6f5219dfa90e9e4b179806d13237d6992f6e712c1807d
7
+ data.tar.gz: e6dae4e417d11adc36730be4e6b7a4ca98dc03c664bc3a65408162db64f0406afb6cff0108b37ce35cb871356745650bf376a6fd52ccba2a34ba28ed65b94faf
data/CHANGELOG.md ADDED
@@ -0,0 +1,127 @@
1
+ # SchemaPlus
2
+
3
+ ## Change Log
4
+
5
+ ### 1.5.2
6
+
7
+ * For now, pin to rspec 2.* and limit rails to 4.1.1 (issue #158)
8
+
9
+ ### 1.5.1
10
+
11
+ * Now respects ActiveRecord::SchemaDumper.ignore_tables for views (issue #153)
12
+
13
+ ### 1.5.0
14
+ * Can now be used with activerecord standalone, doesn't need all of rails.
15
+ * `views` ignores postgres internal views, thanks to [@everplays](https://github.com/everplays) (issue #147)
16
+
17
+ ### 1.4.1
18
+
19
+ * Bug fixes `migration.add_references` with `polymophic: true` (issue #145 and others)
20
+
21
+ ### 1.4.0
22
+
23
+ * Supports jruby & mysql, thanks to [@rzenha](https://github.com/razenha)
24
+ * Works with MRI ruby & rails 4.1.0beta3
25
+ * Run tests against MRI 2.1.0
26
+
27
+ ### 1.3.3
28
+
29
+ * Bug fix, dump unique index with expression (Issue #142)
30
+
31
+
32
+ ### 1.3.2
33
+
34
+ * Bug fix, remove_index with if_exists but no name
35
+ * Sort indexes alphabetically when dumping, like rails does
36
+
37
+ ### 1.3.1
38
+
39
+ * Regression bug fix, non-option arguemnts to remove_index
40
+
41
+ ### 1.3.0
42
+
43
+ * Added :if_exists option for remove_index
44
+ * Initial jruby support (rails 3.2, postgresql), due to efforts of [@donv](https://github.com/donv)
45
+ * Preliminatry groundwork for rails 4.1, due to efforts of [@tovodeverett](https://github.com/tovodeverett)
46
+ * Bug fix for change_table
47
+ * Bug fix for schema_dump postgresql non-btree indexes
48
+ * Bug fix regarding expressions that cast non-string columns to strings in a lower()
49
+
50
+ ### 1.2.0
51
+ * Now works with rails 4, due to efforts of [@tovodeverett](https://github.com/tovodeverett)
52
+ * Test against MRI ruby 2.0.0, no longer test against 1.9.2
53
+
54
+ ### 1.1.2
55
+ * Now works with rails 3.2.13 (fixed railtie initialization)
56
+
57
+ ### 1.1.1
58
+
59
+ * Dependency constraint to rails 3.2.12 max, since schema_plus doesn't
60
+ currently work with 3.2.13.rc2
61
+
62
+ ### 1.1.0
63
+
64
+ * Add support for drop_table :cascade => true. Note that until now,
65
+ :cascade was implicitly true. So this change might break existing code
66
+ that relied on the incorrect implicit cascade behavior.
67
+ * Add support for :deferrable => :initially_deferred (thanks to
68
+ [@bhavinkamani](https://github.com/bhavinkamani))
69
+ * Works with PostGIS (thanks to [@pete](https://github.com/pete))
70
+ * Bug fix: Circular Reference/Stack Level Too Deep in Column#to_json.
71
+ Thanks to [@robdimarco](https://github.com/robdimarco) for tracking down the problem
72
+ * Bug fix: More robust handling of foreign keys with schema namespaces
73
+
74
+
75
+ ### 1.0.1
76
+
77
+ * README cleanups (thanks to [@denispeplin](https://github.com/denispeplin))
78
+ * Now raises ArgumentError if index has both :case_sensitive => false and an
79
+ :expression
80
+ * Now creates consistent default name for foreign key constraints
81
+ * Bug fix: respect :length keyword for index (thanks to [@teleological](https://github.com/teleological))
82
+ * Bug fix: renaming table with multiple foreign key constraints (thanks to
83
+ [@teleological](https://github.com/teleological))
84
+ * Bug fix: don't dump :case_sensitive => false for index with an expression
85
+ that includes "lower(name)".
86
+ * Bug fix: Properly dump multi-column case-insensitive indexes
87
+
88
+
89
+ ### 1.0.0
90
+
91
+ * No longer support rails < 3.2 and ruby < 1.9
92
+ * New feature: specify foreign key constraints using :foreign_key => { ...
93
+ }, motivated in particular to support :name (suggested by [@daniele-m](https://github.com/daniele-m))
94
+ * New feature: create view using ActiveRecord relation
95
+ * New feature: `ActiveRecord::DB_DEFAULT` (suggested by
96
+ [@zaadjis](https://github.com/zaadjis))
97
+ * New feature: renaming a table renames its indexes and constraints
98
+ correspondingly.
99
+ * Bug fix for postgres :kind index attribute (thanks to [@eugenebolshakov](https://github.com/eugenebolshakov))
100
+ * Sort fks in dump for stability (thanks to [@zephyr-dev](https://github.com/zephyr-dev))
101
+ * Bug fix: change_column should maintain foreign key constraints even when
102
+ config.foreign_keys.auto_create is false
103
+ * Bug fix: quote default expressions in schema dump (thanks to [@jonleighton](https://github.com/jonleighton))
104
+ * Bug fix: when removing a foreign key constraint, remove its auto-generated
105
+ index.
106
+ * Bug fix: SchemaDumper.ignore_tables needs to support regexps (suggested by
107
+ [@mtalcott](https://github.com/mtalcott))
108
+ * Bug fix: More robust handling of Postgresql schema_search path (suggested
109
+ by [@mtalcott](https://github.com/mtalcott))
110
+ * Bug fix: Only get index, view, and foreign key information from current
111
+ schema (thanks to [@bhavinkamani](https://github.com/bhavinkamani))
112
+
113
+
114
+ ### Earlier releases
115
+ * 0.4.1 - Bug fix: don't attempt foreign key creation for t.belongs_to ...
116
+ :polymorphic => true
117
+ * 0.4.0 - Add :force for create_view (suggested by [@greglazarev](https://github.com/greglazarev)). cleanups
118
+ by [@betelgeuse](https://github.com/betelgeuse)
119
+ * 0.3.4 - Bug fix: regression causing :default => false to be ignored
120
+ * 0.3.3 - Bug fix: properly handle boolean defaults in mysql
121
+ * 0.3.2 - Bug fix: make sure rake db:schema:load initializes schema_plus
122
+ * 0.3.1 - Bug fix for PostgreSQL schema dump after change_column_default(...
123
+ nil)
124
+ * 0.3.0 - Add :default => expressions (Thanks to Luke Saunders). support
125
+ rails 3.2 and ruby 1.9.3
126
+ * 0.2.1 - Suppress duplicate add_indexes. compatibility with rails
127
+ 3.2.0.rc2
data/README.md CHANGED
@@ -17,7 +17,7 @@ For added rails DRYness see also the gems
17
17
 
18
18
  SchemaPlus supports all combinations of:
19
19
 
20
- * Rails/ActiveRecord 3.2, 4.0, and 4.1 (currently 4.1.0beta3)
20
+ * Rails/ActiveRecord 3.2, 4.0, and 4.1 (currently 4.1.1)
21
21
  * PostgreSQL, MySQL (using mysql2 gem; mysql gem only supported with Rails
22
22
  3.2), or SQLite3 (using sqlite3 >= 3.7.7 which has foreign key support)
23
23
  * MRI Ruby 1.9.3, 2.0.0, or 2.1.0
@@ -191,10 +191,10 @@ SchemaPlus extends rails' `drop_table` method to accept these options:
191
191
  drop_table :table_name, if_exists: true # no error if table doesn't exist
192
192
  drop_table :table_name, cascade: true # delete dependencies
193
193
 
194
- The `:cascade` option is particularly useful given foreign key constraints.
194
+ The `:cascade` option is particularly useful given foreign key constraints.
195
195
  For Postgresql it is implemented using `DROP TABLE...CASCADE` which deletes
196
196
  all dependencies. For MySQL, SchemaPlus implements the `:cascade` option to
197
- delete foreign key references, but does not delete any other dependencies.
197
+ delete foreign key references, but does not delete any other dependencies.
198
198
  For Sqlite3, the `:cascade` option is ignored, but Sqlite3 always drops tables
199
199
  with cascade-like behavior.
200
200
 
@@ -259,7 +259,7 @@ expression). For example:
259
259
  post.update_attributes(category: ActiveRecord::DB_DEFAULT)
260
260
 
261
261
  (Without `ActiveRecord::DB_DEFAULT`, you can update a value to `NULL` but not
262
- to its default value.)
262
+ to its default value.)
263
263
 
264
264
  Note that after updating, you would need to reload a record to replace
265
265
  `ActiveRecord::DB_DEFAULT` with the value assigned by the database.
@@ -292,145 +292,74 @@ of foreign key constraints, you can re-enable it:
292
292
  create_table ...etc...
293
293
  end
294
294
 
295
- ## Release notes:
296
295
 
297
- ### Master branch (to be released)
298
-
299
- * *nothing currently waiting to be released*
300
-
301
-
302
- ### 1.5.1
303
-
304
- * Now respects ActiveRecord::SchemaDumper.ignore_tables for views (issue #153)
305
-
306
- ### 1.5.0
307
- * Can now be used with activerecord standalone, doesn't need all of rails.
308
- * `views` ignores postgres internal views, thanks to [@everplays](https://github.com/everplays) (issue #147)
309
-
310
- ### 1.4.1
311
-
312
- * Bug fixes `migration.add_references` with `polymophic: true` (issue #145 and others)
313
-
314
- ### 1.4.0
315
-
316
- * Supports jruby & mysql, thanks to [@rzenha](https://github.com/razenha)
317
- * Works with MRI ruby & rails 4.1.0beta3
318
- * Run tests against MRI 2.1.0
296
+ ## History
319
297
 
320
- ### 1.3.3
298
+ * See [CHANGELOG](CHANGELOG.md) for per-version release notes.
321
299
 
322
- * Bug fix, dump unique index with expression (Issue #142)
300
+ * SchemaPlus is derived from several "Red Hill On Rails" plugins originally
301
+ created by [@harukizaemon](https://github.com/harukizaemon)
323
302
 
303
+ * SchemaPlus was created in 2011 by [@mlomnicki](https://github.com/mlomnicki) and [@ronen](https://github.com/ronen)
324
304
 
325
- ### 1.3.2
305
+ * And [lots of contributors](https://github.com/lomba/schema_plus/graphs/contributors) since then
326
306
 
327
- * Bug fix, remove_index with if_exists but no name
328
- * Sort indexes alphabetically when dumping, like rails does
307
+ ## Development & Testing
329
308
 
330
- ### 1.3.1
309
+ Are you interested in contributing to schema_plus? Thanks!
331
310
 
332
- * Regression bug fix, non-option arguemnts to remove_index
311
+ Schema_plus has a full set of rspec tests. [travis-ci](http://travis-ci.org/lomba/schema_plus) runs the tests on the full matrix of supported versions of ruby, rails, and db adapters. But you can also test all or some part of the matrix locally before you push your changes. Here's what you need to know:
333
312
 
334
- ### 1.3.0
313
+ #### Required environment:
335
314
 
336
- * Added :if_exists option for remove_index
337
- * Initial jruby support (rails 3.2, postgresql), due to efforts of [@donv](https://github.com/donv)
338
- * Preliminatry groundwork for rails 4.1, due to efforts of [@tovodeverett](https://github.com/tovodeverett)
339
- * Bug fix for change_table
340
- * Bug fix for schema_dump postgresql non-btree indexes
341
- * Bug fix regarding expressions that cast non-string columns to strings in a lower()
315
+ * You must have either [rbenv](https://github.com/sstephenson/rbenv) or [rvm](http://rvm.io) installed and working, whichever you prefer. Within it, have available whichever ruby versions you want to test. The default set is MRI 1.9.3, 2.0.0, 2.1.0, and jruby
342
316
 
343
- ### 1.2.0
344
- * Now works with rails 4, due to efforts of [@tovodeverett](https://github.com/tovodeverett)
345
- * Test against MRI ruby 2.0.0, no longer test against 1.9.2
317
+ * Of course you must have installed whichever databases you want to test. The default set is: PostgreSQL, MySQL, and SQLite3.
346
318
 
347
- ### 1.1.2
348
- * Now works with rails 3.2.13 (fixed railtie initialization)
319
+ * For PostgreSQL and MySQL the tests need a db user with permissions to create and access databases: The default username used by the specs is 'postgres' for Postgresql and 'schema_plus' for MySQL; you can change them via:
349
320
 
350
- ### 1.1.1
321
+ $ export POSTGRES_DB_USER = pgusername
322
+ $ export MYSQL_DB_USER = mysqlusername
351
323
 
352
- * Dependency constraint to rails 3.2.12 max, since schema_plus doesn't
353
- currently work with 3.2.13.rc2
324
+ * For PostgreSQL and MySQL you must explicitly create the databases used by the tests:
354
325
 
355
- ### 1.1.0
326
+ $ rake create_databases # creates both postgresql & mysql
327
+ OR
328
+ $ rake postgresql:create_databases
329
+ $ rake mysql:create_databases
356
330
 
357
- * Add support for drop_table :cascade => true. Note that until now,
358
- :cascade was implicitly true. So this change might break existing code
359
- that relied on the incorrect implicit cascade behavior.
360
- * Add support for :deferrable => :initially_deferred (thanks to
361
- [@bhavinkamani](https://github.com/bhavinkamani))
362
- * Works with PostGIS (thanks to [@pete](https://github.com/pete))
363
- * Bug fix: Circular Reference/Stack Level Too Deep in Column#to_json.
364
- Thanks to [@robdimarco](https://github.com/robdimarco) for tracking down the problem
365
- * Bug fix: More robust handling of foreign keys with schema namespaces
331
+ #### Running the tests
366
332
 
333
+ The tests are run via a script in the repo root. Its args are documented by
367
334
 
368
- ### 1.0.1
335
+ $ ./runspecs --help
369
336
 
370
- * README cleanups (thanks to [@denispeplin](https://github.com/denispeplin))
371
- * Now raises ArgumentError if index has both :case_sensitive => false and an
372
- :expression
373
- * Now creates consistent default name for foreign key constraints
374
- * Bug fix: respect :length keyword for index (thanks to [@teleological](https://github.com/teleological))
375
- * Bug fix: renaming table with multiple foreign key constraints (thanks to
376
- [@teleological](https://github.com/teleological))
377
- * Bug fix: don't dump :case_sensitive => false for index with an expression
378
- that includes "lower(name)".
379
- * Bug fix: Properly dump multi-column case-insensitive indexes
337
+ By default it runs on a matrix of postgresql, mysql2, and sqlite3, for all rubies and all versions of rails. But the matrix options `--db`, `--ruby`, and `--rails` options let you limit those. The `--quick` option runs on just one set: postgresql, rails 4.1 and ruby 2.1.0. The `--full` option adds the mysql adapter to the set (in addition to mysql2 adapter).
380
338
 
339
+ * Install gem dependencies for the sets you'll be testing:
381
340
 
382
- ### 1.0.0
341
+ $ ./runspecs [matrix options] --install # runs 'bundle install' for all sets
342
+ e.g.
343
+ $ ./runspecs --db 'posgresql' --ruby '2.1.0' --rails '4.0 4.1' --install
383
344
 
384
- * No longer support rails < 3.2 and ruby < 1.9
385
- * New feature: specify foreign key constraints using :foreign_key => { ...
386
- }, motivated in particular to support :name (suggested by [@daniele-m](https://github.com/daniele-m))
387
- * New feature: create view using ActiveRecord relation
388
- * New feature: `ActiveRecord::DB_DEFAULT` (suggested by
389
- [@zaadjis](https://github.com/zaadjis))
390
- * New feature: renaming a table renames its indexes and constraints
391
- correspondingly.
392
- * Bug fix for postgres :kind index attribute (thanks to [@eugenebolshakov](https://github.com/eugenebolshakov))
393
- * Sort fks in dump for stability (thanks to [@zephyr-dev](https://github.com/zephyr-dev))
394
- * Bug fix: change_column should maintain foreign key constraints even when
395
- config.foreign_keys.auto_create is false
396
- * Bug fix: quote default expressions in schema dump (thanks to [@jonleighton](https://github.com/jonleighton))
397
- * Bug fix: when removing a foreign key constraint, remove its auto-generated
398
- index.
399
- * Bug fix: SchemaDumper.ignore_tables needs to support regexps (suggested by
400
- [@mtalcott](https://github.com/mtalcott))
401
- * Bug fix: More robust handling of Postgresql schema_search path (suggested
402
- by [@mtalcott](https://github.com/mtalcott))
403
- * Bug fix: Only get index, view, and foreign key information from current
404
- schema (thanks to [@bhavinkamani](https://github.com/bhavinkamani))
345
+ * Run all the tests:
405
346
 
347
+ $ ./runspecs [matrix options] # runs rspec for each set in the matrix
348
+ e.g.
349
+ $ ./runspecs --db 'posgresql' --ruby '2.1.0' --rails '4.0 4.1'
406
350
 
407
- ### Earlier releases
408
- * 0.4.1 - Bug fix: don't attempt foreign key creation for t.belongs_to ...
409
- :polymorphic => true
410
- * 0.4.0 - Add :force for create_view (suggested by [@greglazarev](https://github.com/greglazarev)). cleanups
411
- by [@betelgeuse](https://github.com/betelgeuse)
412
- * 0.3.4 - Bug fix: regression causing :default => false to be ignored
413
- * 0.3.3 - Bug fix: properly handle boolean defaults in mysql
414
- * 0.3.2 - Bug fix: make sure rake db:schema:load initializes schema_plus
415
- * 0.3.1 - Bug fix for PostgreSQL schema dump after change_column_default(...
416
- nil)
417
- * 0.3.0 - Add :default => expressions (Thanks to Luke Saunders). support
418
- rails 3.2 and ruby 1.9.3
419
- * 0.2.1 - Suppress duplicate add_indexes. compatibility with rails
420
- 3.2.0.rc2
351
+ Code coverage information will be in coverage/index.html -- it should be at 100% coverage if you're running against all databases.
421
352
 
353
+ * To run rspec on just a limited set of specs, you can do:
422
354
 
423
- ## History
355
+ $ ./runspecs [matrix options] --rspec -- [rspec args]
356
+ e.g.
357
+ $ ./runspecs --quick --rspec -- spec/migration_spec.rb -e 'default name'
424
358
 
425
- * SchemaPlus is derived from several "Red Hill On Rails" plugins originally
426
- created by [@harukizaemon](https://github.com/harukizaemon)
427
-
428
- * SchemaPlus was created in 2011 by [@mlomnicki](https://github.com/mlomnicki) and [@ronen](https://github.com/ronen)
359
+ Contributions to making the testing process itself easier and better will also be gratefully accepted!
429
360
 
430
- * And [lots of
431
- contributors](https://github.com/lomba/schema_plus/graphs/contributors)
432
- since then
433
361
 
362
+ -
434
363
 
435
364
 
436
365
  [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lomba/schema_plus/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "rails", "~> 4.1.0.beta1"
3
+ gem "rails", ">= 4.1.0.beta1", "<= 4.1.1"
@@ -1,3 +1,3 @@
1
1
  module SchemaPlus
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
data/schema_plus.gemspec CHANGED
@@ -21,11 +21,11 @@ Gem::Specification.new do |s|
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_dependency("activerecord", ">= 3.2")
24
+ s.add_dependency("activerecord", ">= 3.2", "<= 4.1.1")
25
25
  s.add_dependency("valuable")
26
26
 
27
27
  s.add_development_dependency("rake")
28
- s.add_development_dependency("rspec")
28
+ s.add_development_dependency("rspec", "< 2.99")
29
29
  s.add_development_dependency("rdoc")
30
30
  s.add_development_dependency("simplecov")
31
31
  s.add_development_dependency("simplecov-gem-adapter")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronen Barzel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-17 00:00:00.000000000 Z
12
+ date: 2014-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -18,6 +18,9 @@ dependencies:
18
18
  - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3.2'
21
+ - - <=
22
+ - !ruby/object:Gem::Version
23
+ version: 4.1.1
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,6 +28,9 @@ dependencies:
25
28
  - - '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '3.2'
31
+ - - <=
32
+ - !ruby/object:Gem::Version
33
+ version: 4.1.1
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: valuable
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -57,16 +63,16 @@ dependencies:
57
63
  name: rspec
58
64
  requirement: !ruby/object:Gem::Requirement
59
65
  requirements:
60
- - - '>='
66
+ - - <
61
67
  - !ruby/object:Gem::Version
62
- version: '0'
68
+ version: '2.99'
63
69
  type: :development
64
70
  prerelease: false
65
71
  version_requirements: !ruby/object:Gem::Requirement
66
72
  requirements:
67
- - - '>='
73
+ - - <
68
74
  - !ruby/object:Gem::Version
69
- version: '0'
75
+ version: '2.99'
70
76
  - !ruby/object:Gem::Dependency
71
77
  name: rdoc
72
78
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +128,7 @@ files:
122
128
  - .gitignore
123
129
  - .rspec
124
130
  - .travis.yml
131
+ - CHANGELOG.md
125
132
  - Gemfile
126
133
  - MIT-LICENSE
127
134
  - README.md