aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Exclude `:name` and `:type` from `prepare_column_options`Ryuta Kamizono2016-02-291-6/+6
| | | | Actually `:name` and `:type` are not column options.
* `schema_type` returns symbol rather than stringRyuta Kamizono2016-02-081-3/+3
| | | | | | | | | A return value of `schema_type` is used by: 1. primary key type: using as `symbol.inspect` 2. normal column type: using as `symbol.to_s` It is better to return symbol.
* Add expression support on the schema defaultRyuta Kamizono2016-01-131-1/+7
| | | | | | | | Example: create_table :posts do |t| t.datetime :published_at, default: -> { 'NOW()' } end
* Merge pull request #20815 from ↵Matthew Draper2015-12-181-2/+2
|\ | | | | | | | | | | byroot/do-not-include-column-limit-if-it-is-default Do not include column limit in schema.rb if it matches the default
| * Do not include column limit in schema.rb if it matches the defaultJean Boussier2015-07-081-2/+2
| | | | | | | | | | | | | | | | When working on engines that supports multiple databases, it's very annoying to have a different schema.rb output based on which database you use. MySQL being the primary offender. This patch should reduce the disparities a bit.
* | Move the methods for schema dumping into `{mysql,postgresql}/schema_dumper.rb`Ryuta Kamizono2015-10-131-1/+1
| | | | | | | | | | Current master branch includes many schema dumping improvements. It extract these features to the appropriate files.
* | Fix minor docs [ci skip] amitkumarsuroliya2015-09-281-1/+1
|/
* Divide methods for handling column options separatelyRyuta Kamizono2015-05-181-4/+24
|
* Move the collation handling code from the MySQL adapter to common classesRyuta Kamizono2015-05-041-1/+9
| | | | | Some databases like MySQL allow defining collation charset for specific columns.
* Correctly dump `serial` and `bigserial`Ryuta Kamizono2015-03-041-1/+5
|
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-1/+1
|
* The datetime precision with zero should be dumpedRyuta Kamizono2015-02-111-1/+1
| | | | | `precision: 0` was not dumped by f1a0fa9e19b7e4ccaea191fc6cf0613880222ee7. However, `precision: 0` is valid value for PostgreSQL timestamps.
* Refactor microsecond precision to be database agnosticSean Griffin2015-02-101-1/+1
| | | | | | | | | | The various databases don't actually need significantly different handling for this behavior, and they can achieve it without knowing about the type of the object. The old implementation was returning a string, which will cause problems such as breaking TZ aware attributes, and making it impossible for the adapters to supply their logic for time objects.
* Remove most type related predicates from `Column`Sean Griffin2015-01-301-2/+3
| | | | | | Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL
* Improve a dump of the primary key support.Ryuta Kamizono2014-12-291-0/+6
| | | | If it is not a default primary key, correctly dump the type and options.
* no need to pass native_database_types aroundYves Senn2014-12-021-4/+4
|
* Remove redundant `to_s` in interpolationclaudiob2014-10-301-1/+1
|
* Include default column limits in schema.rbJeremy Kemper2014-09-101-4/+8
| | | | | | Allows :limit defaults to be changed without pulling the rug out from under old migrations that omitted :limit because it matched the default at the time.
* Don't type cast the default on the columnSean Griffin2014-06-171-1/+11
| | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* Remove unused requireSean Griffin2014-06-111-2/+0
| | | | We're not longer using `ipaddr` in schema dumper
* refactor, introduce `Type#type_cast_for_schema` to cast for schema.rbYves Senn2014-05-301-26/+1
| | | | | | | This removes the case statement in `SchemaDumper` and gives every `Type` the possibility to control the SchemaDumper default value output. /cc @sgrif
* Remove special case in schema dumper for decimal without scaleSean Griffin2014-05-231-9/+2
|
* The sql_type method called here is fromRafael Mendonça França2013-03-251-1/+1
| | | | | | | ActiveRecord::ConnectionAdapters::Column See https://github.com/rails/rails/blob/28b8ca766e3e7c6c43d3ae900c99f8377153c62/activerecord/lib/active_record/connection_adapters/column.rb#L16
* Fix default output for postgres network address typesErik Peterson2013-02-261-0/+11
|
* Typo fixCarson McDonald2013-02-251-1/+1
|
* Add postgresql range types supportbUg2013-01-231-0/+3
|
* Moves column dump specific code to a module included in AbstractAdapterDan McClain2012-09-141-0/+56
Having column related schema dumper code in the AbstractAdapter. The code remains the same, but by placing it in the AbstractAdapter, we can then overwrite it with Adapter specific methods that will help with Adapter specific data types. The goal of moving this code here is to create a new migration key for PostgreSQL's array type. Since any datatype can be an array, the goal is to have ':array => true' as a migration option, turning the datatype into an array. I've implemented this in postgres_ext, the syntax is shown here: https://github.com/dockyard/postgres_ext#arrays Adds array migration support Adds array_test.rb outlining the test cases for array data type Adds pg_array_parser to Gemfile for testing Adds pg_array_parser to postgresql_adapter (unused in this commit) Adds schema dump support for arrays Adds postgres array type casting support Updates changelog, adds note for inet and cidr support, which I forgot to add before Removing debugger, Adds pg_array_parser to JRuby platform Removes pg_array_parser requirement, creates ArrayParser module used by PostgreSQLAdapter