1. 30 11月, 2017 1 次提交
    • G
      Add support for PostgreSQL operator classes to add_index · 1dca75c2
      Greg Navis 提交于
      Add support for specifying non-default operator classes in PostgreSQL
      indexes. An example CREATE INDEX query that becomes possible is:
      
          CREATE INDEX users_name ON users USING gist (name gist_trgm_ops);
      
      Previously it was possible to specify the `gist` index but not the
      custom operator class. The `add_index` call for the above query is:
      
          add_index :users, :name, using: :gist, opclasses: {name: :gist_trgm_ops}
      1dca75c2
  2. 25 10月, 2017 1 次提交
    • Y
      Implement `PostgreSQL::SchemaDumper#extensions` · cf4ba2fa
      Yasuo Honda 提交于
      and abstract `SchemaDumper#extensions` is now an empty method.
      
      Since #30337, every database adapter has its own `SchemaDumper`.
      `extensions` are only supported by PostgreSQL database and postgresql database adapter.
      cf4ba2fa
  3. 27 8月, 2017 1 次提交
  4. 24 8月, 2017 1 次提交
  5. 22 8月, 2017 1 次提交
  6. 05 8月, 2017 1 次提交
    • Y
      Allow `table_name_prefix` and `table_name_suffix` have `$` · b49c6dce
      Yasuo Honda 提交于
      MySQL 5.7 and PostgreSQL 9.6 allow table identifiers have the dollar sign.
      
      * MySQL 5.7
      https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
      
      > Permitted characters in unquoted identifiers:
      >  ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)
      
      * PostgreSQL 9.6
      https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html
      
      > SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable. The SQL standard will not define a key word that contains digits or starts or ends with an underscore, so identifiers of this form are safe against possible conflict with future extensions of the standard.
      
      Address #30044
      
      [Yasuo Honda & Ryuta Kamizono]
      b49c6dce
  7. 20 7月, 2017 1 次提交
  8. 13 7月, 2017 1 次提交
    • J
      Sort enabled adapter extensions in schema dump · 8dca9219
      Jan Pieper 提交于
      The list of enabled adapter extensions in the schema dump isn't
      sorted by default, so it may happen that the sorting changes
      over time. If you're using a VCS, a change to the sorting results
      in a diff without any real change. Sorting the list should solve
      this problem.
      8dca9219
  9. 02 7月, 2017 1 次提交
  10. 01 7月, 2017 1 次提交
  11. 03 6月, 2017 1 次提交
  12. 16 5月, 2017 1 次提交
  13. 09 4月, 2017 1 次提交
    • R
      Tweaks #28678 · 1d05e64b
      Ryuta Kamizono 提交于
      * Fix the comment on `formatted_version`
      * Extract `define_params`
      * Remove duplicated guard clause for `@version`
      1d05e64b
  14. 06 4月, 2017 1 次提交
  15. 28 2月, 2017 1 次提交
  16. 14 2月, 2017 1 次提交
  17. 13 2月, 2017 1 次提交
  18. 29 10月, 2016 1 次提交
  19. 11 10月, 2016 2 次提交
  20. 10 10月, 2016 2 次提交
    • R
      `name` is not a column option · 24a1a6a8
      Ryuta Kamizono 提交于
      `migration_keys` includes `name` but `name` is not a column option.
      24a1a6a8
    • R
      Dump index options to pretty format · 5025fd3a
      Ryuta Kamizono 提交于
      ```ruby
        # Before
        t.index ["firm_id", "type", "rating"], name: "company_index", order: {"rating"=>:desc}, using: :btree
      
        # After
        t.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree
      ```
      5025fd3a
  21. 08 10月, 2016 1 次提交
  22. 23 8月, 2016 2 次提交
  23. 17 8月, 2016 1 次提交
  24. 16 8月, 2016 1 次提交
  25. 07 8月, 2016 1 次提交
  26. 02 7月, 2016 1 次提交
  27. 10 6月, 2016 1 次提交
  28. 12 5月, 2016 1 次提交
  29. 20 4月, 2016 2 次提交
  30. 19 4月, 2016 1 次提交
  31. 16 4月, 2016 1 次提交
  32. 11 3月, 2016 1 次提交
  33. 08 3月, 2016 1 次提交
  34. 06 2月, 2016 1 次提交
    • S
      Revert "Dump indexes in `create_table` instead of `add_index`" · d666a5a5
      Sean Griffin 提交于
      This reverts commit 99801c6a.
      
      Ultimately it doesn't matter whether `add_index` or `t.index` are used
      in the schema dumper in any meaningful way. There are gems out there
      which hook into the old behavior for things like indexing materialized
      views. Since the reverted commit doesn't seem to add much benefit,
      there's no reason for us to break these gems.
      d666a5a5
  35. 08 1月, 2016 1 次提交
    • S
      Prevent destructive action on production database · 900bfd94
      schneems 提交于
      This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd.
      
      It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large.
      
      To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
      900bfd94
  36. 23 9月, 2015 1 次提交
    • Y
      introduce `conn.data_source_exists?` and `conn.data_sources`. · 152b85f0
      Yves Senn 提交于
      These new methods are used from the Active Record model layer to
      determine which relations are viable to back a model. These new methods
      allow us to change `conn.tables` in the future to only return tables and
      no views. Same for `conn.table_exists?`.
      
      The goal is to provide the following introspection methods on the
      connection:
      
      * `tables`
      * `table_exists?`
      * `views`
      * `view_exists?`
      * `data_sources` (views + tables)
      * `data_source_exists?` (views + tables)
      152b85f0