schema_plus 1.8.9 → 2.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -4
- data/.travis.yml +1 -47
- data/CHANGELOG.md +0 -35
- data/README.md +73 -107
- data/Rakefile +7 -10
- data/TODO.md +51 -0
- data/gemfiles/Gemfile.base +2 -0
- data/lib/schema_column_plus.rb +7 -0
- data/lib/{schema_plus → schema_column_plus}/active_record/connection_adapters/column.rb +13 -11
- data/lib/schema_column_plus/middleware/model.rb +22 -0
- data/lib/schema_db_default.rb +13 -0
- data/lib/{schema_plus → schema_db_default}/active_record/attribute.rb +4 -4
- data/lib/schema_db_default/db_default.rb +17 -0
- data/lib/schema_db_default/middleware.rb +30 -0
- data/lib/schema_default_expr.rb +32 -0
- data/lib/schema_default_expr/active_record/connection_adapters/mysql_adapter.rb +17 -0
- data/lib/schema_default_expr/active_record/connection_adapters/postgresql_adapter.rb +18 -0
- data/lib/schema_default_expr/active_record/connection_adapters/sqlite3_adapter.rb +35 -0
- data/lib/schema_default_expr/middleware.rb +54 -0
- data/lib/schema_pg_enums.rb +6 -0
- data/lib/schema_pg_enums/active_record.rb +69 -0
- data/lib/schema_pg_enums/middleware.rb +23 -0
- data/lib/schema_plus.rb +17 -45
- data/lib/schema_plus/active_record/base.rb +6 -23
- data/lib/schema_plus/active_record/connection_adapters/abstract_adapter.rb +80 -181
- data/lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb +78 -99
- data/lib/schema_plus/active_record/connection_adapters/mysql_adapter.rb +34 -114
- data/lib/schema_plus/active_record/connection_adapters/postgresql_adapter.rb +16 -370
- data/lib/schema_plus/active_record/connection_adapters/schema_statements.rb +1 -67
- data/lib/schema_plus/active_record/connection_adapters/sqlite3_adapter.rb +18 -112
- data/lib/schema_plus/active_record/connection_adapters/table_definition.rb +14 -116
- data/lib/schema_plus/active_record/migration/command_recorder.rb +8 -59
- data/lib/schema_plus/middleware/dumper.rb +94 -0
- data/lib/schema_plus/middleware/migration.rb +167 -0
- data/lib/schema_plus/middleware/model.rb +17 -0
- data/lib/schema_plus/version.rb +1 -1
- data/lib/schema_plus_tables.rb +15 -0
- data/lib/schema_plus_tables/active_record/connection_adapters/abstract_adapter.rb +20 -0
- data/lib/schema_plus_tables/active_record/connection_adapters/mysql_adapter.rb +25 -0
- data/lib/schema_plus_tables/active_record/connection_adapters/postgresql_adapter.rb +13 -0
- data/lib/schema_plus_tables/active_record/connection_adapters/sqlite3_adapter.rb +12 -0
- data/lib/schema_views.rb +16 -0
- data/lib/schema_views/active_record/connection_adapters/abstract_adapter.rb +41 -0
- data/lib/schema_views/active_record/connection_adapters/mysql_adapter.rb +30 -0
- data/lib/schema_views/active_record/connection_adapters/postgresql_adapter.rb +31 -0
- data/lib/schema_views/active_record/connection_adapters/sqlite3_adapter.rb +18 -0
- data/lib/schema_views/middleware.rb +47 -0
- data/schema_dev.yml +1 -31
- data/schema_plus.gemspec +11 -9
- data/spec/foreign_key_definition_spec.rb +7 -7
- data/spec/foreign_key_spec.rb +63 -48
- data/spec/migration_spec.rb +58 -203
- data/spec/named_schemas_spec.rb +5 -88
- data/spec/{column_spec.rb → schema_column_plus/column_spec.rb} +26 -48
- data/spec/schema_db_default/column_spec.rb +58 -0
- data/spec/{column_default_spec.rb → schema_default_expr/column_default_spec.rb} +1 -2
- data/spec/schema_default_expr/schema_dumper_spec.rb +116 -0
- data/spec/schema_dumper_spec.rb +22 -327
- data/spec/{enum_spec.rb → schema_pg_enums/enum_spec.rb} +1 -1
- data/spec/schema_pg_enums/schema_dumper_spec.rb +37 -0
- data/spec/schema_views/named_schemas_spec.rb +97 -0
- data/spec/{views_spec.rb → schema_views/views_spec.rb} +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/support/matchers/reference.rb +11 -12
- metadata +104 -57
- data/gemfiles/rails-3.2/Gemfile.base +0 -3
- data/gemfiles/rails-3.2/Gemfile.mysql +0 -10
- data/gemfiles/rails-3.2/Gemfile.mysql2 +0 -10
- data/gemfiles/rails-3.2/Gemfile.postgresql +0 -10
- data/gemfiles/rails-3.2/Gemfile.sqlite3 +0 -10
- data/gemfiles/rails-4.0/Gemfile.base +0 -3
- data/gemfiles/rails-4.0/Gemfile.mysql2 +0 -10
- data/gemfiles/rails-4.0/Gemfile.postgresql +0 -10
- data/gemfiles/rails-4.0/Gemfile.sqlite3 +0 -10
- data/gemfiles/rails-4.1/Gemfile.base +0 -3
- data/gemfiles/rails-4.1/Gemfile.mysql2 +0 -10
- data/gemfiles/rails-4.1/Gemfile.postgresql +0 -10
- data/gemfiles/rails-4.1/Gemfile.sqlite3 +0 -10
- data/lib/schema_plus/active_record/column_options_handler.rb +0 -117
- data/lib/schema_plus/active_record/connection_adapters/index_definition.rb +0 -70
- data/lib/schema_plus/active_record/db_default.rb +0 -19
- data/lib/schema_plus/active_record/foreign_keys.rb +0 -137
- data/lib/schema_plus/active_record/schema_dumper.rb +0 -171
- data/lib/schema_plus/railtie.rb +0 -20
- data/spec/index_definition_spec.rb +0 -211
- data/spec/index_spec.rb +0 -249
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 090fdf5adb8715e2bb78a10c58b7f5f5d4e9b219
|
4
|
+
data.tar.gz: 8950e08cdd6cbf912cb8508e40ce4b2449f914a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcd75a62438cf8a1feb618f37a2e7e99bdc30a6691bf0131908978af5e8410ae330f537692f97e64b1a3f10f9588faeafc6c16860213d1d9dafeb9ac1bef7395
|
7
|
+
data.tar.gz: 6088b9ddf4b227aa4fa021c3ebed7be1369c881efcc392a5942d692a82ca5ba8e5058d35387d1794afecbde9e4ed1b143caa435aab7f09cff5d47fb81ec502af
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -6,19 +6,8 @@
|
|
6
6
|
sudo: false
|
7
7
|
rvm:
|
8
8
|
- 1.9.3
|
9
|
-
- 2.1.
|
10
|
-
- jruby
|
9
|
+
- 2.1.5
|
11
10
|
gemfile:
|
12
|
-
- gemfiles/rails-3.2/Gemfile.mysql
|
13
|
-
- gemfiles/rails-3.2/Gemfile.mysql2
|
14
|
-
- gemfiles/rails-3.2/Gemfile.postgresql
|
15
|
-
- gemfiles/rails-3.2/Gemfile.sqlite3
|
16
|
-
- gemfiles/rails-4.0/Gemfile.mysql2
|
17
|
-
- gemfiles/rails-4.0/Gemfile.postgresql
|
18
|
-
- gemfiles/rails-4.0/Gemfile.sqlite3
|
19
|
-
- gemfiles/rails-4.1/Gemfile.mysql2
|
20
|
-
- gemfiles/rails-4.1/Gemfile.postgresql
|
21
|
-
- gemfiles/rails-4.1/Gemfile.sqlite3
|
22
11
|
- gemfiles/rails-4.2/Gemfile.mysql2
|
23
12
|
- gemfiles/rails-4.2/Gemfile.postgresql
|
24
13
|
- gemfiles/rails-4.2/Gemfile.sqlite3
|
@@ -28,38 +17,3 @@ addons:
|
|
28
17
|
before_script: bundle exec rake create_databases
|
29
18
|
after_script: bundle exec rake drop_databases
|
30
19
|
script: bundle exec rake travis
|
31
|
-
matrix:
|
32
|
-
exclude:
|
33
|
-
- rvm: jruby
|
34
|
-
gemfile: gemfiles/rails-3.2/Gemfile.postgresql
|
35
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
36
|
-
- rvm: jruby
|
37
|
-
gemfile: gemfiles/rails-3.2/Gemfile.sqlite3
|
38
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
39
|
-
- rvm: jruby
|
40
|
-
gemfile: gemfiles/rails-4.0/Gemfile.mysql2
|
41
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
42
|
-
- rvm: jruby
|
43
|
-
gemfile: gemfiles/rails-4.0/Gemfile.postgresql
|
44
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
45
|
-
- rvm: jruby
|
46
|
-
gemfile: gemfiles/rails-4.0/Gemfile.sqlite3
|
47
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
48
|
-
- rvm: jruby
|
49
|
-
gemfile: gemfiles/rails-4.1/Gemfile.mysql2
|
50
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
51
|
-
- rvm: jruby
|
52
|
-
gemfile: gemfiles/rails-4.1/Gemfile.postgresql
|
53
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
54
|
-
- rvm: jruby
|
55
|
-
gemfile: gemfiles/rails-4.1/Gemfile.sqlite3
|
56
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
57
|
-
- rvm: jruby
|
58
|
-
gemfile: gemfiles/rails-4.2/Gemfile.mysql2
|
59
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
60
|
-
- rvm: jruby
|
61
|
-
gemfile: gemfiles/rails-4.2/Gemfile.postgresql
|
62
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
63
|
-
- rvm: jruby
|
64
|
-
gemfile: gemfiles/rails-4.2/Gemfile.sqlite3
|
65
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
data/CHANGELOG.md
CHANGED
@@ -2,41 +2,6 @@
|
|
2
2
|
|
3
3
|
## Change Log
|
4
4
|
|
5
|
-
## 1.8.9
|
6
|
-
|
7
|
-
* Bug fix: Disable auto_create when sqlite3 implicitly copies a table (#213)
|
8
|
-
|
9
|
-
## 1.8.8
|
10
|
-
|
11
|
-
* Bug fix: Postgres index creation was ignoring option `algorithm: :concurrently` (#209)
|
12
|
-
|
13
|
-
## 1.8.7
|
14
|
-
|
15
|
-
* Bug fix: Postgres schema dump failed when using case_sensitive => false and operator_class together (#204). Thanks to [@mikeauclair](https://github.com/mikeauclair)
|
16
|
-
|
17
|
-
* Bug fix: With complex cyclic foreign key dependencies, schema dump would issue constraint before table definition (#203). Thanks to [@konjoot](https://github.com/konjoot)
|
18
|
-
|
19
|
-
|
20
|
-
## 1.8.6
|
21
|
-
|
22
|
-
* Bug fix: Don't drop column `array: true` for ActiveRecord 4.2. (#199)
|
23
|
-
|
24
|
-
## 1.8.5
|
25
|
-
|
26
|
-
* Bug fix: DB_DEFAULT shouldn't cause t.inet columns to fail. (#198)
|
27
|
-
|
28
|
-
## 1.8.4
|
29
|
-
|
30
|
-
* Bug fix: Allow default value as hash for json columns (#195)
|
31
|
-
|
32
|
-
## 1.8.3
|
33
|
-
|
34
|
-
* Don't modifiy migration column options hashes (#191). Thanks to [@lowjoel](https://github.com/lowjoel)
|
35
|
-
|
36
|
-
## 1.8.2
|
37
|
-
|
38
|
-
* Bug fix when using t.references in change_table (#194). Thanks to [@boone](https://github.com/boone)
|
39
|
-
|
40
5
|
## 1.8.1
|
41
6
|
|
42
7
|
* Bug fix for AR 4.2, spurious add_foreign_key statements at the top of schema dump. Thanks to [@tovodeverett](https://github.com/tovodeverett) for doing better testing than me!
|
data/README.md
CHANGED
@@ -1,135 +1,123 @@
|
|
1
|
-
> ## This is the README for schema_plus 1.8.x
|
2
|
-
> which supports Rails 3.2, 4.0, 4.1, and 4.2.0. Ongoing development towards schema_plus 2.0 takes place in the [master branch](https://github.com/SchemaPlus/schema_plus/tree/master), supporting only Rails >= 4.2
|
3
1
|
|
4
|
-
|
5
|
-
|
6
|
-
# SchemaPlus
|
7
|
-
|
8
|
-
|
9
|
-
SchemaPlus is an ActiveRecord extension that provides enhanced capabilities
|
10
|
-
for schema definition and querying, including: enhanced and more DRY index
|
11
|
-
capabilities, support and automation for foreign key constraints, and support
|
12
|
-
for views.
|
2
|
+
> ## This is the README for SchemaPlus 2.0.0 (prelease)
|
3
|
+
> which is under development in the master branch, and which supports Rails >= 4.2. For info about the stable 1.x releases which support Rails 3.1, 4.0, 4.1, and 4.2, see the [schema_plus 1.x](https://github.com/SchemaPlus/schema_plus/tree/1.x) branch
|
13
4
|
|
14
|
-
|
15
|
-
[schema_associations](http://rubygems.org/gems/schema_associations) and
|
16
|
-
[schema_validations](http://rubygems.org/gems/schema_validations)
|
5
|
+
---
|
17
6
|
|
18
7
|
[![Gem Version](https://badge.fury.io/rb/schema_plus.svg)](http://badge.fury.io/rb/schema_plus)
|
19
8
|
[![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_plus.svg)](http://travis-ci.org/SchemaPlus/schema_plus)
|
20
9
|
[![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_plus.svg)](https://coveralls.io/r/SchemaPlus/schema_plus)
|
21
10
|
[![Dependency Status](https://gemnasium.com/lomba/schema_plus.svg)](https://gemnasium.com/SchemaPlus/schema_plus)
|
22
11
|
|
23
|
-
|
12
|
+
# SchemaPlus 2.x
|
24
13
|
|
25
|
-
|
14
|
+
Starting with version 2.0.0, schema_plus is a wrapper that pulls in a collection of individual feature gems:
|
26
15
|
|
27
|
-
*
|
28
|
-
*
|
29
|
-
3.2), or SQLite3 (using sqlite3 >= 3.7.7 for foreign key support, >= 3.8 for partial indexes)
|
30
|
-
* MRI Ruby >= 1.9.3
|
16
|
+
* [schema_plus_indexes](https://github.com/SchemaPlus/schema_plus_indexes) -- Convenience and consistency in defining and manipulting indexes
|
17
|
+
* [schema_plus_pg_indexes](https://github.com/SchemaPlus/schema_plus_pg_indexes) -- Support for PostgreSQL index features: `case_insenstive`, `expression` and `operator_class`
|
31
18
|
|
32
|
-
|
19
|
+
See detailed documentation in each feature gem's README. You can of course just use whichever of those gems you want individually, rather than this wrapper.
|
33
20
|
|
34
|
-
|
21
|
+
> **IN PROGRESS:** In the prerelease versions of SchemaPlus 2.0, more feature gems have yet to be stripped out, and the code is still in the body of schema_plus. Anticipated features gems include:
|
22
|
+
>
|
23
|
+
> * schema_plus_columns -- Extra Column features, including `column.indexes` and `column.unique?`
|
24
|
+
> * schema_plus_db_default -- Supports `update_attributes!(my_attr: ActiveRecord::DB_DEFAULT)` to set a column back to the default in the database schema.
|
25
|
+
> * schema_plus_default_expr -- Supports using SQL expressions for database default values
|
26
|
+
> * schema_plus_enums -- Support for enum types
|
27
|
+
> * schema_plus_foreign_keys -- Extends support for foreign keys, including automatic creation.
|
28
|
+
> * schema_plus_tables -- Convenience and consistency in defining and manipulating tables
|
29
|
+
> * schema_plus_views -- Adds support for creating and manipulating views
|
30
|
+
>
|
31
|
+
> The documentation for these features is at the end of this README
|
35
32
|
|
36
33
|
|
37
|
-
##
|
34
|
+
## Upgrading from SchemaPlus 1.8.x
|
38
35
|
|
39
|
-
|
36
|
+
SchemaPlus 2.0.x intends to be a completely backwards-compatible drop-in replacement for SchemaPlus 1.8.x, for projects using rails 4.2.
|
40
37
|
|
41
|
-
|
38
|
+
If you find any incompatibilities, please report an issue!
|
42
39
|
|
43
|
-
|
40
|
+
### Deprecations
|
41
|
+
In cases where rails 4.2 has introduced features previously supported only by SchemaPlus, but using different names, SchemaPlus 2.0 now issues deprecation warnings in favor of the rails form. The complete list of deprecations:
|
44
42
|
|
45
|
-
|
43
|
+
* Index definitions deprecate these options:
|
44
|
+
* `:conditions` => `:where`
|
45
|
+
* `:kind` => `:using`
|
46
46
|
|
47
|
-
|
47
|
+
* Foreign key definitions deprecate options to `:on_update` and `:on_delete`:
|
48
|
+
* `:set_null` => `:nullify`
|
48
49
|
|
49
|
-
|
50
|
-
|
50
|
+
* `add_foreign_key` and `remove_foreign_key` deprecate the method signature:
|
51
|
+
* `(from_table, columns, to_table, primary_keys, options)` => `(from_table, to_table, options)`
|
51
52
|
|
52
|
-
|
53
|
+
* `ForeignKeyDefinition` deprecates accessors:
|
54
|
+
* `#table_name` in favor of `#from_table`
|
55
|
+
* `#column_names` in favor of `#column`
|
56
|
+
* `#references_column_names` in favor of `#primary_key`
|
57
|
+
* `#references_table_name in favor of `#to_table`
|
53
58
|
|
54
|
-
|
55
|
-
|
59
|
+
* `IndexDefinition` deprecates accessors:
|
60
|
+
* `#conditions` in favor of `#where`
|
61
|
+
* `#kind` in favor of `#using`
|
56
62
|
|
57
|
-
|
58
|
-
create_table :parts do |t|
|
59
|
-
t.string :name
|
60
|
-
t.string :product_code
|
61
|
-
end
|
63
|
+
## Compatibility
|
62
64
|
|
63
|
-
|
64
|
-
add_index :parts, :product_code, unique: true
|
65
|
+
SchemaPlus 2.x is tested against all combinations of:
|
65
66
|
|
66
|
-
|
67
|
-
|
67
|
+
<!-- SCHEMA_DEV: MATRIX - begin -->
|
68
|
+
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
|
69
|
+
* ruby **1.9.3** with rails **4.2**, using **mysql2**, **sqlite3** or **postgresql**
|
70
|
+
* ruby **2.1.5** with rails **4.2**, using **mysql2**, **sqlite3** or **postgresql**
|
68
71
|
|
69
|
-
|
70
|
-
create_table :parts do |t|
|
71
|
-
t.string :name, index: true
|
72
|
-
t.string :product_code, index: { unique: true }
|
73
|
-
end
|
72
|
+
<!-- SCHEMA_DEV: MATRIX - end -->
|
74
73
|
|
75
|
-
|
74
|
+
## Installation
|
76
75
|
|
77
|
-
|
76
|
+
Install from http://rubygems.org via
|
78
77
|
|
79
|
-
|
78
|
+
$ gem install "schema_plus"
|
80
79
|
|
81
|
-
|
82
|
-
t.string :last_name, index: { with: :first_name }
|
80
|
+
or in a Gemfile
|
83
81
|
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
gem "schema_plus"
|
83
|
+
|
84
|
+
## History
|
87
85
|
|
88
|
-
|
86
|
+
* See [CHANGELOG](CHANGELOG.md) for per-version release notes.
|
89
87
|
|
90
|
-
|
91
|
-
|
88
|
+
* SchemaPlus is derived from several "Red Hill On Rails" plugins originally
|
89
|
+
created by [@harukizaemon](https://github.com/harukizaemon)
|
92
90
|
|
93
|
-
|
91
|
+
* SchemaPlus was created in 2011 by [@mlomnicki](https://github.com/mlomnicki) and [@ronen](https://github.com/ronen)
|
94
92
|
|
95
|
-
|
93
|
+
* And [lots of contributors](https://github.com/SchemaPlus/schema_plus/graphs/contributors) since then
|
96
94
|
|
97
|
-
|
95
|
+
## Development & Testing
|
98
96
|
|
99
|
-
|
97
|
+
Are you interested in contributing to schema_plus? Thanks!
|
100
98
|
|
101
|
-
|
102
|
-
expressions, index methods, operator classes, and case-insensitive indexes:
|
99
|
+
Schema_plus has a full set of rspec tests. [travis-ci](http://travis-ci.org/SchemaPlus/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, using
|
103
100
|
|
104
|
-
|
105
|
-
t.string :last_name, index: { expression: 'upper(last_name)' }
|
106
|
-
t.string :last_name, index: { kind: 'hash' }
|
107
|
-
t.string :last_name, index: { operator_class: 'varchar_pattern_ops' }
|
108
|
-
t.string :last_name, index: { with: :address, operator_class: {last_name: 'varchar_pattern_ops', address: 'text_pattern_ops' }
|
109
|
-
t.string :last_name, index: { case_sensitive: false } # shorthand for expression: 'lower(last_name)'
|
101
|
+
$ schema_dev rspec
|
110
102
|
|
111
103
|
|
112
|
-
|
113
|
-
doc for [SchemaPlus::ActiveRecord::ConnectionAdapters::PostgresqlAdapter](http://rubydoc.info/gems/schema_plus/SchemaPlus/ActiveRecord/ConnectionAdapters/PostgresqlAdapter) and
|
114
|
-
[SchemaPlus::ActiveRecord::ConnectionAdapters::IndexDefinition](http://rubydoc.info/gems/schema_plus/SchemaPlus/ActiveRecord/ConnectionAdapters/IndexDefinition)
|
104
|
+
For more details, see the [schema_dev](https://github.com/SchemaPlus/schema_dev) README.
|
115
105
|
|
116
|
-
|
117
|
-
|
118
|
-
reference the column, whether the column must be unique, etc. See doc for
|
119
|
-
[SchemaPlus::ActiveRecord::ConnectionAdapters::Column](http://rubydoc.info/gems/schema_plus/SchemaPlus/ActiveRecord/ConnectionAdapters/Column).
|
106
|
+
---
|
107
|
+
---
|
120
108
|
|
121
|
-
|
109
|
+
# Prerelease: Documentation of features still be moved into separate feature gems
|
122
110
|
|
123
|
-
|
124
|
-
|
125
|
-
an error. SchemaPlus regularizes the behavor to ignore the attempt for
|
126
|
-
all db adapters.
|
111
|
+
|
112
|
+
> **NOTE** The documentation in this README is leftover from the 1.x branch; the functionality is the same, but some of the core features of schema_plus (such as foreign keys & inline index definition) are now provided by ActiveRecord 4.2. schema_plus still provides extra functionality beyond AR 4.2, but the documentation needs to be updated to be clear what's an enhancement of AR 4.2 capabilities rather than completely new features.
|
127
113
|
|
128
|
-
|
129
|
-
convention will be renamed correspondingly.
|
114
|
+
### Columns
|
130
115
|
|
131
|
-
* `remove_index` now accepts an `:if_exists` option to prevent errors from attempting to remove non-existent indexes.
|
132
116
|
|
117
|
+
When you query column information using ActiveRecord::Base#columns, SchemaPlus
|
118
|
+
analogously provides index information relevant to each column: which indexes
|
119
|
+
reference the column, whether the column must be unique, etc. See doc for
|
120
|
+
[SchemaPlus::ActiveRecord::ConnectionAdapters::Column](http://rubydoc.info/gems/schema_plus/SchemaPlus/ActiveRecord/ConnectionAdapters/Column).
|
133
121
|
|
134
122
|
### Foreign Key Constraints
|
135
123
|
|
@@ -329,25 +317,3 @@ of foreign key constraints, you can re-enable it:
|
|
329
317
|
end
|
330
318
|
|
331
319
|
|
332
|
-
## History
|
333
|
-
|
334
|
-
* See [CHANGELOG](CHANGELOG.md) for per-version release notes.
|
335
|
-
|
336
|
-
* SchemaPlus is derived from several "Red Hill On Rails" plugins originally
|
337
|
-
created by [@harukizaemon](https://github.com/harukizaemon)
|
338
|
-
|
339
|
-
* SchemaPlus was created in 2011 by [@mlomnicki](https://github.com/mlomnicki) and [@ronen](https://github.com/ronen)
|
340
|
-
|
341
|
-
* And [lots of contributors](https://github.com/SchemaPlus/schema_plus/graphs/contributors) since then
|
342
|
-
|
343
|
-
## Development & Testing
|
344
|
-
|
345
|
-
Are you interested in contributing to schema_plus? Thanks!
|
346
|
-
|
347
|
-
Schema_plus has a full set of rspec tests. [travis-ci](http://travis-ci.org/SchemaPlus/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, using
|
348
|
-
|
349
|
-
$ schema_dev rspec
|
350
|
-
|
351
|
-
|
352
|
-
For more details, see the [schema_dev](https://github.com/SchemaPlus/schema_dev) README.
|
353
|
-
|
data/Rakefile
CHANGED
@@ -5,17 +5,14 @@ require 'schema_dev/tasks'
|
|
5
5
|
|
6
6
|
task :default => :spec
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Rake::RDocTask.new do |rdoc|
|
12
|
-
require File.dirname(__FILE__) + '/lib/schema_plus/version'
|
8
|
+
require 'rdoc/task'
|
9
|
+
Rake::RDocTask.new do |rdoc|
|
10
|
+
require File.dirname(__FILE__) + '/lib/schema_plus/version'
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
12
|
+
rdoc.rdoc_dir = 'rdoc'
|
13
|
+
rdoc.title = "schema_plus #{SchemaPlus::VERSION}"
|
14
|
+
rdoc.rdoc_files.include('README*')
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
19
16
|
end
|
20
17
|
|
21
18
|
require 'rspec/core/rake_task'
|
data/TODO.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
## ALL
|
2
|
+
|
3
|
+
* ideally get rid of all uses of alias_method_chain outside schema_monkey (create middleware)
|
4
|
+
* rename everything to schema_plus_* (except schema_monkey and schema_plus)
|
5
|
+
|
6
|
+
## schema_plus_tables
|
7
|
+
|
8
|
+
* depcrecate cascade: true in favor of force: cascade
|
9
|
+
* use middleware
|
10
|
+
* move specs over
|
11
|
+
|
12
|
+
## schema_plus_index
|
13
|
+
* remove index specs that are testing things now handled by AR. (then see if coverage is still 100%)
|
14
|
+
|
15
|
+
## schema_plus
|
16
|
+
* deprecate config => SchemaForeignKeys config
|
17
|
+
* move fk stuff into schema_foreign_keys
|
18
|
+
* add specs to cover the deprecations
|
19
|
+
* just do fk enhancements rather than replace AR's add_foreign_key and remove_foreign_key methods and foreign key lookups
|
20
|
+
|
21
|
+
## schema_monkey
|
22
|
+
* consider automating the autoloads
|
23
|
+
* make middleware for remove_index
|
24
|
+
* make middleware for remove_column
|
25
|
+
* make middleware for rename_table
|
26
|
+
* make middleware for create_table
|
27
|
+
* make middleware for visit_TableDefinition
|
28
|
+
* make middleware for loading a schema
|
29
|
+
* make middleware for defining a table
|
30
|
+
* make ExecCache middleware work for all three adapters.
|
31
|
+
* @dump should include the header for consistency
|
32
|
+
* specs for schema_monkey
|
33
|
+
* README to document it -- the conventions and internal API
|
34
|
+
* (try it on AR 4.1? nah)
|
35
|
+
|
36
|
+
## general
|
37
|
+
* rename schema_pg_enum to just schema_enum?
|
38
|
+
* pull apart READMEs
|
39
|
+
* test each gem separately to make sure they don't accidentally depend on each other
|
40
|
+
|
41
|
+
## schema_dev things:
|
42
|
+
|
43
|
+
* boilerplate in README regarding the schema_plus family?
|
44
|
+
* boilerplate in README regarding test matrix?
|
45
|
+
* default 'rspec'
|
46
|
+
* don't bother changing ruby if it's the current version anyway.
|
47
|
+
* rename 'refresh' to 'freshen'; get rid of the individual travis & gem commands
|
48
|
+
* have a .schema_dev file with current settings
|
49
|
+
* make it obvious and easy to override
|
50
|
+
* auto update .gitignore to ignore it?
|
51
|
+
* log files should go in log/ not in tmp/ (auto update .gitignore to ignore it?)
|
data/gemfiles/Gemfile.base
CHANGED