Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
pulled out schema_plus_tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ronen committed Feb 14, 2015
1 parent d4eb6e2 commit 5a8d56d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 54 deletions.
20 changes: 5 additions & 15 deletions README.md
Expand Up @@ -24,7 +24,7 @@ Gem | Description | Included In `schema_plus` gem?
<p style="color:grey">schema_plus_foreign_keys | Extended support for foreign keys, including creation as column options, `:deferrable`, and SQLite3 support | Y
[schema_plus_indexes](https://github.com/SchemaPlus/schema_plus_indexes) | Convenience and consistency in using indexes | Y
[schema_plus_pg_indexes](https://github.com/SchemaPlus/schema_plus_pg_indexes) |PostgreSQL index features: `case_insenstive`, `expression` and `operator_class` | Y
<p style="color:grey">schema_plus_tables</p> | Convenience and consistency in using tables | Y
[schema_plus_tables](https://github.com/SchemaPlus/schema_plus_views) | Convenience and consistency in using tables | Y
[schema_plus_views](https://github.com/SchemaPlus/schema_plus_views) | Create and drop views in migrations | Y
[schema_validations](https://github.com/SchemaPlus/schema_validations) | Automatically defines ActiveRecord validations based on database constraints |

Expand Down Expand Up @@ -56,6 +56,9 @@ In cases where ActiveRecord 4.2 has introduced features previously supported onl
* `:conditions` => `:where`
* `:kind` => `:using`

* `drop_table` deprecates this option:
* `cascade: true` => `force: :cascade`

* Foreign key definitions deprecate options to `:on_update` and `:on_delete`:
* `:set_null` => `:nullify`

Expand Down Expand Up @@ -176,20 +179,7 @@ has some information that may be of assistance in resolving these issues.

### Tables

SchemaPlus extends rails' `drop_table` method to accept these options:

drop_table :table_name # same as rails
drop_table :table_name, if_exists: true # no error if table doesn't exist
drop_table :table_name, cascade: true # delete dependencies

The `:cascade` option is particularly useful given foreign key constraints.
For Postgresql it is implemented using `DROP TABLE...CASCADE` which deletes
all dependencies. For MySQL, SchemaPlus implements the `:cascade` option to
delete foreign key references, but does not delete any other dependencies.
For Sqlite3, the `:cascade` option is ignored, but Sqlite3 always drops tables
with cascade-like behavior.

SchemaPlus likewise extends `create_table ... force: true` to use `:cascade`
SchemaPlus extends `create_table ... force: true` to use `:cascade`

### Column Defaults: Expressions

Expand Down
5 changes: 0 additions & 5 deletions lib/schema_plus/tables.rb

This file was deleted.

33 changes: 0 additions & 33 deletions lib/schema_plus/tables/middleware.rb

This file was deleted.

3 changes: 2 additions & 1 deletion schema_plus.gemspec
Expand Up @@ -23,11 +23,12 @@ Gem::Specification.new do |gem|

gem.add_dependency "activerecord", "~> 4.2"
gem.add_dependency "valuable"
gem.add_dependency "schema_plus_core", "~> 0.1"
gem.add_dependency "schema_plus_core", "~> 0.2"
gem.add_dependency "schema_monkey_rails", "~> 0.1", ">= 0.1.2"
gem.add_dependency "schema_plus_columns", "~> 0.1"
gem.add_dependency "schema_plus_indexes", "~> 0.1", ">= 0.1.3"
gem.add_dependency "schema_plus_pg_indexes", "~> 0.1", ">= 0.1.3"
gem.add_dependency "schema_plus_tables", "~> 0.1"
gem.add_dependency "schema_plus_views", "~> 0.1"

gem.add_development_dependency "schema_dev", "~> 3.1"
Expand Down

0 comments on commit 5a8d56d

Please sign in to comment.