schema_plus
11 years agoFix PostGIS. master
Pete Elmore [Thu, 7 Mar 2013 03:46:55 +0000 (19:46 -0800)]
Fix PostGIS.

11 years agoMore robust handling of foreign keys with schema namespaces
ronen barzel [Mon, 11 Feb 2013 20:25:33 +0000 (20:25 +0000)]
More robust handling of foreign keys with schema namespaces

Closes issue #89

11 years agoversion bump 1.0.1 v1.0.1
ronen barzel [Mon, 4 Feb 2013 23:13:54 +0000 (23:13 +0000)]
version bump 1.0.1

11 years agospec fix: integerize values for index lengths (mysql2 gives integer lengths, mysql...
ronen barzel [Thu, 24 Jan 2013 12:29:01 +0000 (12:29 +0000)]
spec fix: integerize values for index lengths (mysql2 gives integer lengths, mysql gives string)

11 years agoRevert "spec fix: use eql? to test hash equality ignoring entry order"
ronen barzel [Thu, 24 Jan 2013 12:25:52 +0000 (12:25 +0000)]
Revert "spec fix: use eql? to test hash equality ignoring entry order"

This reverts commit f9a0879775e13fbe134cdbea6269dee1e1bdbaed.

11 years agospec fix: use eql? to test hash equality ignoring entry order
ronen barzel [Thu, 24 Jan 2013 12:21:04 +0000 (12:21 +0000)]
spec fix: use eql? to test hash equality ignoring entry order

11 years agoREADME release notes update
ronen barzel [Thu, 24 Jan 2013 12:13:03 +0000 (12:13 +0000)]
README release notes update

11 years agono need for backwards-compatibility with incorrect :lengths keyword, since it wasn...
ronen barzel [Thu, 24 Jan 2013 12:12:48 +0000 (12:12 +0000)]
no need for backwards-compatibility with incorrect :lengths keyword, since it wasn't working anyway.

11 years agoMerge branch 'master' of github.com:lomba/schema_plus
ronen barzel [Thu, 24 Jan 2013 12:09:39 +0000 (12:09 +0000)]
Merge branch 'master' of github.com:lomba/schema_plus

11 years agoadd spec for index length in migration (mysql only)
ronen barzel [Thu, 24 Jan 2013 11:26:07 +0000 (11:26 +0000)]
add spec for index length in migration (mysql only)

11 years agoMerge pull request #88 from teleological/v1.0.0-patch-2
ronen barzel [Thu, 24 Jan 2013 11:26:24 +0000 (03:26 -0800)]
Merge pull request #88 from teleological/v1.0.0-patch-2

Accept :length option for index definition

11 years agoAccept :length option for index definition
Riley [Wed, 23 Jan 2013 14:00:50 +0000 (09:00 -0500)]
Accept :length option for index definition

* IndexDefinition member is called :lengths, but dumped/read as :length
* Preserved backwards-compatible support for :lengths

11 years agoupdate README history
ronen barzel [Sun, 20 Jan 2013 22:59:31 +0000 (22:59 +0000)]
update README history

11 years agoupdate README history
ronen barzel [Sat, 19 Jan 2013 13:00:27 +0000 (13:00 +0000)]
update README history

11 years agobug fix: foreign keys should have a consistent default name.
ronen barzel [Sun, 20 Jan 2013 22:13:00 +0000 (22:13 +0000)]
bug fix: foreign keys should have a consistent default name.

(also, this uncovered that a spec was creating a duplicate constraint.)

11 years agoadd --rspec command and ARGV to runspecs
ronen barzel [Sun, 20 Jan 2013 21:51:27 +0000 (21:51 +0000)]
add --rspec command and ARGV to runspecs

11 years agofix references matcher to work even if column names aren't specified. remove redunda...
ronen barzel [Sun, 20 Jan 2013 21:42:29 +0000 (21:42 +0000)]
fix references matcher to work even if column names aren't specified.  remove redundant file.

11 years agobug fix: rename when table has more than one constraint.
ronen barzel [Sun, 20 Jan 2013 22:14:50 +0000 (22:14 +0000)]
bug fix: rename when table has more than one constraint.

it could choosing the wrong index.

11 years agoadd spec to test renaming of table with multiple foreign_key constraints.
ronen barzel [Sat, 19 Jan 2013 12:55:46 +0000 (12:55 +0000)]
add spec to test renaming of table with multiple foreign_key constraints.

see issue #87 and its pull request

11 years agoMerge pull request #87 from teleological/v1.0.0-patch
ronen barzel [Sat, 19 Jan 2013 12:53:38 +0000 (04:53 -0800)]
Merge pull request #87 from teleological/v1.0.0-patch

When renaming tables, rename constraints

11 years agoWhen renaming tables, rename constraints
Riley [Fri, 18 Jan 2013 22:39:38 +0000 (16:39 -0600)]
When renaming tables, rename constraints

* Was using new table name; fails for > 1 constraint on table

11 years agocomment for mysql vs mysql2
ronen barzel [Thu, 17 Jan 2013 21:27:03 +0000 (21:27 +0000)]
comment for mysql vs mysql2

11 years agoattempt to get around rake 10.0.3 issue with ruby 1.9.2
ronen barzel [Thu, 17 Jan 2013 08:14:08 +0000 (08:14 +0000)]
attempt to get around rake 10.0.3 issue with ruby 1.9.2

see https://github.com/jimweirich/rake/issues/157

11 years agobug fixes: don't dump :case_sensitive => false for index with an expression that...
ronen barzel [Thu, 17 Jan 2013 02:59:55 +0000 (02:59 +0000)]
bug fixes: don't dump :case_sensitive => false for index with an expression that includes 'lower(name)', and properly dump multi-column case_insensitive indexes.

Closes #84

11 years agoDocument and add Argument error for invalidity of using :case_sensitive => false...
ronen barzel [Thu, 17 Jan 2013 01:54:50 +0000 (01:54 +0000)]
Document and add Argument error for invalidity of using :case_sensitive => false with an expression.

Closes #85

11 years agoREADME typo fix
ronen barzel [Thu, 17 Jan 2013 01:31:15 +0000 (01:31 +0000)]
README typo fix

closes #86

11 years agospecify required_ruby_version
ronen barzel [Sun, 16 Dec 2012 21:51:53 +0000 (21:51 +0000)]
specify required_ruby_version

11 years agoupdate release notes
ronen barzel [Thu, 6 Dec 2012 11:21:25 +0000 (11:21 +0000)]
update release notes

11 years agoMerge pull request #76 from denispeplin/master
ronen barzel [Thu, 6 Dec 2012 11:16:45 +0000 (03:16 -0800)]
Merge pull request #76 from denispeplin/master

Use new hash syntax in README

11 years agoFix bug introduced during the syntax update.
denispeplin [Thu, 6 Dec 2012 10:50:04 +0000 (14:50 +0400)]
Fix bug introduced during the syntax update.

11 years agoRuby 1.8 support was dropped, modify hashes syntax.
denispeplin [Thu, 6 Dec 2012 09:50:21 +0000 (13:50 +0400)]
Ruby 1.8 support was dropped, modify hashes syntax.

11 years agoversion bump 1.0.0 v1.0.0
ronen barzel [Tue, 4 Dec 2012 23:09:09 +0000 (23:09 +0000)]
version bump 1.0.0

11 years agofix travis build
ronen barzel [Tue, 4 Dec 2012 22:34:19 +0000 (22:34 +0000)]
fix travis build

debugged travis locally using method described here: http://ruby-journal.com/debug-your-failed-test-in-travis-ci/

11 years agoreorder Gemfiles
ronen barzel [Tue, 4 Dec 2012 07:17:34 +0000 (07:17 +0000)]
reorder Gemfiles

hopefully this will get around the strange travis behavior after including Gemfile.base -- it was reporting
   could not find gem '<gemname> (>=0) ruby' in the gems available on this machine

11 years agoput each db adapter requirement into separate Gemfile, to enable development/testing...
ronen barzel [Tue, 4 Dec 2012 00:11:22 +0000 (00:11 +0000)]
put each db adapter requirement into separate Gemfile, to enable development/testing without all db's installed on your machine.

updated travis config, Rakefile, runspecs, and README accordingly

11 years agoforce mysql ~>2.8.1 dependency, which is what rails 3.2's mysql adapter requires
ronen barzel [Mon, 3 Dec 2012 22:59:43 +0000 (22:59 +0000)]
force mysql ~>2.8.1 dependency, which is what rails 3.2's mysql adapter requires

11 years agofix gitignore for gemfiles/*.lock
ronen barzel [Mon, 3 Dec 2012 22:33:44 +0000 (22:33 +0000)]
fix gitignore for gemfiles/*.lock

why did i think this was working before?

11 years agoadd multi schema bug fix to release notes
ronen barzel [Mon, 3 Dec 2012 22:32:57 +0000 (22:32 +0000)]
add multi schema bug fix to release notes

11 years agosplit spec into two
ronen barzel [Mon, 3 Dec 2012 22:32:34 +0000 (22:32 +0000)]
split spec into two

11 years agoMerge pull request #74 from bhavinkamani/schema_aware_foreign_key
ronen barzel [Mon, 3 Dec 2012 14:50:05 +0000 (06:50 -0800)]
Merge pull request #74 from bhavinkamani/schema_aware_foreign_key

BUGFIX: schema aware postgresql foreign_keys and reverse_foreign_keys

11 years agoBUGFIX: schema aware postgresql foreign_keys and reverse_foreign_keys. Added multiple...
Bhavin Kamani [Mon, 3 Dec 2012 14:04:25 +0000 (19:34 +0530)]
BUGFIX: schema aware postgresql foreign_keys and reverse_foreign_keys. Added multiple schema foreign_key spec

11 years agoAdd some comments.
ronen barzel [Wed, 28 Nov 2012 10:55:14 +0000 (10:55 +0000)]
Add some comments.

11 years agooops again, i didn't properly test mysql version. fixed missing &block.
ronen barzel [Tue, 27 Nov 2012 03:02:57 +0000 (03:02 +0000)]
oops again, i didn't properly test mysql version.  fixed missing &block.

11 years agooops take out debugging code
ronen barzel [Tue, 27 Nov 2012 02:59:07 +0000 (02:59 +0000)]
oops take out debugging code

11 years agomysql support for DB_DEFAULT
ronen barzel [Tue, 27 Nov 2012 02:55:37 +0000 (02:55 +0000)]
mysql support for DB_DEFAULT

11 years agoadd DB_DEFAULT.
ronen barzel [Tue, 27 Nov 2012 01:58:42 +0000 (01:58 +0000)]
add DB_DEFAULT.

closes #61

11 years agoREADME updates
ronen barzel [Mon, 26 Nov 2012 16:07:11 +0000 (16:07 +0000)]
README updates

11 years agouse postgres current_schemas() function rather than parsing and passing rails schema_...
ronen barzel [Mon, 26 Nov 2012 16:03:16 +0000 (16:03 +0000)]
use postgres current_schemas() function rather than parsing and passing rails schema_search_path parameter.

obviates quoting bug fix shown in commit of issue #65

11 years agobug fix: SchemaDumper.ignore_tables needs to support regexps.
ronen barzel [Mon, 26 Nov 2012 16:01:49 +0000 (16:01 +0000)]
bug fix: SchemaDumper.ignore_tables needs to support regexps.

addresses #65 (albeit implement a different way than the asociated pull request).

11 years agoclean out vestigial view definitions (could be left over from earlier failed specs)
ronen barzel [Mon, 26 Nov 2012 15:58:54 +0000 (15:58 +0000)]
clean out vestigial view definitions (could be left over from earlier failed specs)

11 years agoadd specs to verifiy multiple-schema isolation.
ronen barzel [Mon, 26 Nov 2012 14:50:06 +0000 (14:50 +0000)]
add specs to verifiy multiple-schema isolation.

addresses #62

11 years agoclean up Rakefile for database creation; use it in .travis.yml
ronen barzel [Mon, 26 Nov 2012 14:40:25 +0000 (14:40 +0000)]
clean up Rakefile for database creation; use it in .travis.yml

11 years agocleanups to get to 100% code coverage
ronen barzel [Mon, 26 Nov 2012 12:17:53 +0000 (12:17 +0000)]
cleanups to get to 100% code coverage

11 years agofix for mysql: can't rename index when foreign key still exists.
ronen barzel [Mon, 26 Nov 2012 12:10:03 +0000 (12:10 +0000)]
fix for mysql: can't rename index when foreign key still exists.

11 years agofix Rakefile so that it will report errors if rspec gets errors.
ronen barzel [Mon, 26 Nov 2012 11:28:43 +0000 (11:28 +0000)]
fix Rakefile so that it will report errors if rspec gets errors.

*this* time travis-ci will fail for sure!  :)

(previous checkin was good to do, but didn't affect travis-ci since it doesn't run ./runspecs)

11 years agofix runspecs to return error status.
ronen barzel [Mon, 26 Nov 2012 10:49:01 +0000 (10:49 +0000)]
fix runspecs to return error status.

so now travis will properly report failures.  and this commit will cause travis to fail, because of bug in earlier commit.

11 years agogitignore gemfiles/*.lock
ronen barzel [Sun, 25 Nov 2012 23:35:07 +0000 (23:35 +0000)]
gitignore gemfiles/*.lock

11 years agoupdate README to document index renaming. And update release notes.
ronen barzel [Sun, 25 Nov 2012 23:31:00 +0000 (23:31 +0000)]
update README to document index renaming. And update release notes.

closes #64

11 years agowhen a table renamed, rename the foreign key constraints
ronen barzel [Sun, 25 Nov 2012 23:21:37 +0000 (23:21 +0000)]
when a table renamed, rename the foreign key constraints
(except for sqlite3, which doesn't support that)

addresses #64

11 years agowhen table is renamed, should rename fk auto-indexes
ronen barzel [Sun, 25 Nov 2012 23:00:42 +0000 (23:00 +0000)]
when table is renamed, should rename fk auto-indexes

addresses #64

11 years agowhen a table is renamed, rename rails-named indexes
ronen barzel [Sun, 25 Nov 2012 22:52:41 +0000 (22:52 +0000)]
when a table is renamed, rename rails-named indexes

addresses #64

11 years agoindex definition should not raise error when testing equality against nil.
ronen barzel [Sun, 25 Nov 2012 21:01:16 +0000 (21:01 +0000)]
index definition should not raise error when testing equality against nil.

addresses #64

11 years agoidentify auto-created indexes by name "fk__#{table}_#{column}". remove auto-created...
ronen barzel [Sun, 25 Nov 2012 17:27:51 +0000 (17:27 +0000)]
identify auto-created indexes by name "fk__#{table}_#{column}".  remove auto-created index when removing a foreign key.

also identified and fixed a bug inadvertently introduced in previous checkin: specifying :foreign_key => false suppressed :index => true

closes #50

11 years agoMerge branch 'master' of github.com:lomba/schema_plus
ronen barzel [Sun, 25 Nov 2012 15:28:42 +0000 (15:28 +0000)]
Merge branch 'master' of github.com:lomba/schema_plus

11 years agoupdate README release notes
ronen barzel [Wed, 14 Nov 2012 15:57:15 +0000 (15:57 +0000)]
update README release notes

11 years agoMerge pull request #72 from jonleighton/fix_default_expr_dump
ronen barzel [Wed, 14 Nov 2012 15:54:31 +0000 (07:54 -0800)]
Merge pull request #72 from jonleighton/fix_default_expr_dump

Fix schema dumper with complex expressions

11 years agoFix schema dumper with complex expressions
Jon Leighton [Wed, 14 Nov 2012 10:42:00 +0000 (10:42 +0000)]
Fix schema dumper with complex expressions

Previously, these were getting dumped without quote marks being escaped,
leading to syntax errors in the schema.rb.

11 years agoreplace development dependency 'ruby-debugger19' with 'debugger'
ronen barzel [Sun, 11 Nov 2012 11:15:16 +0000 (11:15 +0000)]
replace development dependency 'ruby-debugger19' with 'debugger'

11 years agocreate_view can be defined using a Relation
ronen barzel [Sun, 11 Nov 2012 08:36:07 +0000 (08:36 +0000)]
create_view can be defined using a Relation

(really, can take anything that responds to :to_sql)

11 years agoupdate & tweak README
ronen barzel [Sun, 11 Nov 2012 08:35:14 +0000 (08:35 +0000)]
update & tweak README

11 years agoinclude index order in schema dump.
ronen barzel [Sat, 10 Nov 2012 22:54:24 +0000 (22:54 +0000)]
include index order in schema dump.

this, along with the previous two commits, closes #60

11 years agoadd spec for add_index(..., :order => ...). get it to work for postgresql
ronen barzel [Wed, 7 Nov 2012 12:14:22 +0000 (12:14 +0000)]
add spec for add_index(..., :order => ...).  get it to work for postgresql

11 years agoIndexDefinition.orders now works for postgresql and sqlite3. ordered indexes aren...
ronen barzel [Tue, 6 Nov 2012 23:49:27 +0000 (23:49 +0000)]
IndexDefinition.orders now works for postgresql and sqlite3.  ordered indexes aren't supported by mysql.

11 years agoupdate version to 1.0.0.pre for now.
ronen barzel [Wed, 7 Nov 2012 22:40:05 +0000 (22:40 +0000)]
update version to 1.0.0.pre for now.

11 years agolegacy cleanup: remove monkey patch specific to rails 3.1 from abstract adapter
ronen barzel [Wed, 7 Nov 2012 22:37:01 +0000 (22:37 +0000)]
legacy cleanup: remove monkey patch specific to rails 3.1 from abstract adapter

11 years agolegacy cleanup: remove guard for rails >= 3.0 from index spec
ronen barzel [Wed, 7 Nov 2012 22:36:38 +0000 (22:36 +0000)]
legacy cleanup:  remove guard for rails >= 3.0 from index spec

11 years agodrop legacy support: gemspec now requires rails >= 3.2. No longer test rails <...
ronen barzel [Wed, 7 Nov 2012 22:28:20 +0000 (22:28 +0000)]
drop legacy support:  gemspec now requires rails >= 3.2.  No longer test rails < 3.2, nor ruby < 1.9.

11 years agoanother bug fix on maintaining foreign keys.
ronen barzel [Wed, 7 Nov 2012 08:08:26 +0000 (08:08 +0000)]
another bug fix on maintaining foreign keys.

for mysql: it throws an error attempting to detect foreign keys on a nonexistent table.

11 years agoREADME release notes update
ronen barzel [Sat, 3 Nov 2012 02:23:12 +0000 (02:23 +0000)]
README release notes update

11 years agoNew :foreign_key => { … } specifier in migration column statements and methods
ronen barzel [Sat, 3 Nov 2012 01:47:17 +0000 (01:47 +0000)]
New :foreign_key => { … } specifier in migration column statements and methods

Closes #69

11 years agoadd spec to make sure we're dumping fk name
ronen barzel [Sat, 3 Nov 2012 01:46:51 +0000 (01:46 +0000)]
add spec to make sure we're dumping fk name

11 years agoadd (failing) specs for new :foreign_key => { … } syntax
ronen barzel [Sat, 3 Nov 2012 01:39:23 +0000 (01:39 +0000)]
add (failing) specs for new :foreign_key => { … } syntax

11 years agomerge two different migration_spec files
ronen barzel [Fri, 2 Nov 2012 23:11:06 +0000 (23:11 +0000)]
merge two different migration_spec files

11 years agotidy up specs regarding earlier move to inline schema definition
ronen barzel [Fri, 2 Nov 2012 23:04:53 +0000 (23:04 +0000)]
tidy up specs regarding earlier move to inline schema definition

11 years agoclean up migration_spec
ronen barzel [Fri, 2 Nov 2012 22:45:09 +0000 (22:45 +0000)]
clean up migration_spec

11 years agobug fix on the change_colum checkin: don't try to remove existing foreign key if...
ronen barzel [Fri, 2 Nov 2012 22:44:58 +0000 (22:44 +0000)]
bug fix on the change_colum checkin: don't try to remove existing foreign key if we're about to drop the whole table.

11 years agoclean up foreign key specs
ronen barzel [Fri, 2 Nov 2012 21:09:27 +0000 (21:09 +0000)]
clean up foreign key specs

11 years agoupdate README release notes
ronen barzel [Fri, 2 Nov 2012 16:28:57 +0000 (16:28 +0000)]
update README release notes

11 years agobug fix: change_column should maintain existing foreign key even when config.foreign_...
ronen barzel [Fri, 2 Nov 2012 16:24:10 +0000 (16:24 +0000)]
bug fix: change_column should maintain existing foreign key even when config.foreign_keys.auto_create = false

Closes #71

11 years agoadd spec for dropping foreign key via change_column
ronen barzel [Fri, 2 Nov 2012 16:20:46 +0000 (16:20 +0000)]
add spec for dropping foreign key via change_column

11 years agoadd failing spec -- migration should maintain foreign key on column change
ronen barzel [Fri, 2 Nov 2012 15:32:11 +0000 (15:32 +0000)]
add failing spec -- migration should maintain foreign key on column change

11 years agospecs cleanup: move schema & model definitions inline rather than loading from extern...
ronen barzel [Thu, 1 Nov 2012 14:26:39 +0000 (14:26 +0000)]
specs cleanup: move schema & model definitions inline rather than loading from external files.

this has two advantages: easier to know what schema is being tested, and can change the schema for an individual set of examples without worrying about implications on other tests.

11 years agoREADME update
ronen barzel [Mon, 29 Oct 2012 19:53:13 +0000 (19:53 +0000)]
README update

11 years agoSort FKs in dump to prevent ordering changes
Brent Wheeldon [Mon, 29 Oct 2012 14:43:03 +0000 (10:43 -0400)]
Sort FKs in dump to prevent ordering changes

11 years agoadd (failing) spec for sorting foreign keys in schema dump
ronen barzel [Mon, 29 Oct 2012 19:30:32 +0000 (19:30 +0000)]
add (failing) spec for sorting foreign keys in schema dump

11 years agobetter internal documentation for abstract methods
ronen barzel [Sat, 20 Oct 2012 16:43:18 +0000 (17:43 +0100)]
better internal documentation for abstract methods

11 years agoMerge pull request #66 from loco2/index_kind
ronen barzel [Tue, 9 Oct 2012 11:05:38 +0000 (04:05 -0700)]
Merge pull request #66 from loco2/index_kind

Fixes for postgres index type and expression support

11 years agoWrap expression in parantheses if necessary when adding an index
Eugene Bolshakov [Tue, 9 Oct 2012 08:52:26 +0000 (09:52 +0100)]
Wrap expression in parantheses if necessary when adding an index

11 years agoActually use the :kind index attribute for postgres
Eugene Bolshakov [Tue, 9 Oct 2012 08:15:14 +0000 (09:15 +0100)]
Actually use the :kind index attribute for postgres

11 years agorspec deprecation: change expect { … }.should to proper expect {…}.to
ronen barzel [Thu, 4 Oct 2012 22:29:25 +0000 (23:29 +0100)]
rspec deprecation: change expect { … }.should to proper expect {…}.to