- 08 9月, 2014 4 次提交
-
-
由 Jeremy Kemper 提交于
-
由 Tee Parham 提交于
* Add private method primary_key_for, which more clearly shows that the expected return value is nil when a primary key is not found.
-
由 Tee Parham 提交于
* Consistent whitespace * Remove unnecessary parentheses
-
由 Tee Parham 提交于
-
- 26 7月, 2014 1 次提交
-
-
由 Caleb Thompson 提交于
Gems which wish to tie into ActiveRecord::SchemaDumper need to duplicate this logic currently. [Foreigner] is one such example, as is a library I'm currently working on but which hasn't been released yet: def tables_with_foreign_keys(stream) tables_without_foreign_keys(stream) @connection.tables.sort.each do |table| next if ['schema_migrations', ignore_tables].flatten.any? do |ignored| case ignored when String; table == ignored when Regexp; table =~ ignored else raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.' end end foreign_keys(table, stream) end end [Foreigner]: https://github.com/matthuhiggins/foreigner/blob/master/lib/foreigner/schema_dumper.rb#L36-L43 Extract the skip logic to a method, making it much simpler to follow this same behavior in gems that are tying into the migration flow and let them dump only tables that aren't skipped without copying this block of code. The above code could then be simplified to: def tables_with_foreign_keys(stream) tables_without_foreign_keys(stream) @connection.tables.sort.each do |table| foreign_keys(table, stream) unless ignored?(table) end end It also, in my opinion, simplifies the logic on ActiveRecord's side, and clarifies the intent of the skip logic.
-
- 11 7月, 2014 1 次提交
-
-
由 Andrey Novikov 提交于
For example, if use pgcrypto extension in PostgreSQL 9.4 beta 1, where uuid-ossp extension isn't available for moment of writing, and thus to use a gen_random_uuid() method as a primary key default. In this case schema dumper wasn't able to correctly reconstruct create_table statement and lost primary key constraint on schema load. Fixes #16111.
-
- 27 6月, 2014 6 次提交
-
-
由 Yves Senn 提交于
The name of the foreign key is not relevant from a users perspective. Using random names resolves the urge to rename the foreign key when the respective table or column is renamed.
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
respect `table_name_prefix` and `table_name_suffix`.
-
- 14 10月, 2013 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
Fixes #12489
-
- 23 8月, 2013 1 次提交
-
-
由 wangjohn 提交于
These options make it easier to change the config from ActiveRecord::Base to use something else inside of the SchemaDumper.
-
- 04 5月, 2013 1 次提交
-
-
由 Brian Buchanan 提交于
-
- 28 3月, 2013 2 次提交
-
-
由 Ken Mazaika 提交于
-
由 Ken Mazaika 提交于
-
- 26 3月, 2013 1 次提交
-
-
由 Ranjay Krishna 提交于
Created a layer of abstraction for the valid type checking in schema dumper. Now, connection handles the check for valid types so that each database can handle the changes individually.
-
- 16 2月, 2013 1 次提交
-
-
由 Jon Leighton 提交于
This reverts commit c321b309. Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb Reason: failing test 1) Error: test_valid_column(ActiveRecord::ConnectionAdapters::SQLite3AdapterTest): NoMethodError: undefined method `column' for test/cases/adapters/sqlite3/sqlite3_adapter_test.rb:29:in `test_valid_column'
-
- 12 2月, 2013 1 次提交
-
-
由 Ranjay Krishna 提交于
-
- 07 2月, 2013 4 次提交
-
-
由 Carlos Antonio da Silva 提交于
When extensions are supported but there's no one enabled in the database, we should not print anything related to them in schema.rb.
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 Justin George 提交于
add ActiveRecord::AbstractAdapter#extensions and ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#extensions to allow dumping of enabled extensions to schema.rb, add ActiveRecord::SchemaDumper#extensions to dump extensions to schema.rb
-
- 10 12月, 2012 1 次提交
-
-
由 Jeremy Kemper 提交于
Pending work on graceful app upgrades. Revert "Merge pull request #8439 from joshsusser/fixes" This reverts commit ce8ac393, reversing changes made to b0e7b6f6. Revert "Merge pull request #8431 from joshsusser/schemadump" This reverts commit 036d3e1c, reversing changes made to 0c692f4d. Revert "Merge branch 'joshsusser-master' into merge" This reverts commit 0c692f4d, reversing changes made to 2e299fca. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/schema_dumper_test.rb
-
- 06 12月, 2012 1 次提交
-
-
由 Josh Susser 提交于
-
- 03 12月, 2012 1 次提交
-
-
由 Josh Susser 提交于
-
- 14 9月, 2012 1 次提交
-
-
由 Dan McClain 提交于
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
-
- 08 9月, 2012 1 次提交
-
-
由 Konstantin Shabanov 提交于
-
- 06 6月, 2012 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 11 4月, 2012 1 次提交
-
-
由 dcurtis 提交于
-
- 09 2月, 2012 1 次提交
-
-
由 Marcelo Silveira 提交于
-
- 10 1月, 2012 1 次提交
-
-
由 kennyj 提交于
Fix GH #4259. We must remove table_name_prefix and table_name_suffix, when we execute schema dumper.
-
- 05 1月, 2012 3 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 19 11月, 2011 2 次提交
-
-
由 kennyj 提交于
-
由 Christos Zisopoulos 提交于
Fixes #3678
-
- 05 11月, 2011 1 次提交
-
-
由 Vlad Jebelev 提交于
-