1. 22 8月, 2015 1 次提交
    • S
      JSON is still an adapter specific type. · ffc4710c
      Sean Griffin 提交于
      Several changes were made in #21110 which I am strongly opposed to.
      (this is what I get for going on vacation. :trollface:) No type should
      be introduced into the generic `ActiveRecord::Type` namespace, and
      *certainly* should not be registered into the registry unconstrained
      unless it is supported by *all* adapters (which basically means that it
      was specified in the ANSI SQL standard).
      
      I do not think `# :nodoc:` ing the type is sufficient, as it still makes
      the code of Rails itself very unclear as to what the role of that class
      is. While I would argue that this shouldn't even be a super class, and
      that MySql and PG's JSON types are only superficially duplicated (they
      might look the same but will change for different reasons in the
      future).
      
      However, I don't feel strongly enough about it as a point of contention
      (and the biggest cost of harming the blameability has already occured),
      so I simply moved the superclass into a namespace where its role is
      absolutely clear.
      
      After this change, `attribute :foo, :json` will once again work with
      MySQL and PG, but not with Sqlite3 or any third party adapters.
      
      Unresolved questions
      --------------------
      
      The types that and adapter publishes (at least those are unique to that
      adapter, and not adding additional behavior like `MysqlString` should
      probably be part of the adapter's public API. Should we standardize the
      namespace for these, and document them?
      ffc4710c
  2. 21 8月, 2015 1 次提交
  3. 18 8月, 2015 1 次提交
  4. 21 7月, 2015 1 次提交
  5. 27 6月, 2015 1 次提交
    • P
      Add reversible syntax for change_column_default · a4128725
      Prem Sichanugrist 提交于
      Passing `:from` and `:to` to `change_column_default` makes this command
      reversible as user has defined its previous state.
      
      So, instead of having the migration command as:
      
          change_column_default(:posts, :state, "draft")
      
      They can write it as:
      
          change_column_default(:posts, :state, from: nil, to: "draft")
      a4128725
  6. 27 5月, 2015 1 次提交
  7. 20 5月, 2015 1 次提交
  8. 19 5月, 2015 1 次提交
  9. 13 5月, 2015 1 次提交
  10. 06 5月, 2015 1 次提交
  11. 04 5月, 2015 3 次提交
  12. 03 5月, 2015 3 次提交
  13. 07 4月, 2015 2 次提交
  14. 06 4月, 2015 1 次提交
  15. 23 3月, 2015 2 次提交
  16. 20 3月, 2015 1 次提交
  17. 17 3月, 2015 1 次提交
  18. 06 3月, 2015 1 次提交
  19. 04 3月, 2015 1 次提交
  20. 26 2月, 2015 1 次提交
    • R
      Add `SchemaMigration.create_table` support any unicode charsets for MySQL. · 3239b6a9
      Ryuta Kamizono 提交于
      MySQL unicode support is not only `utf8mb4`.
      Then, The index length problem is not only `utf8mb4`.
      
      http://dev.mysql.com/doc/refman/5.6/en/charset-unicode.html
      
          SELECT * FROM information_schema.character_sets WHERE maxlen > 3;
          +--------------------+----------------------+------------------+--------+
          | CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION      | MAXLEN |
          +--------------------+----------------------+------------------+--------+
          | utf8mb4            | utf8mb4_general_ci   | UTF-8 Unicode    |      4 |
          | utf16              | utf16_general_ci     | UTF-16 Unicode   |      4 |
          | utf16le            | utf16le_general_ci   | UTF-16LE Unicode |      4 |
          | utf32              | utf32_general_ci     | UTF-32 Unicode   |      4 |
          +--------------------+----------------------+------------------+--------+
      3239b6a9
  21. 25 2月, 2015 2 次提交
  22. 24 2月, 2015 1 次提交
  23. 22 2月, 2015 1 次提交
  24. 20 2月, 2015 2 次提交
  25. 18 2月, 2015 2 次提交
  26. 16 2月, 2015 1 次提交
  27. 12 2月, 2015 1 次提交
  28. 11 2月, 2015 2 次提交
    • R
      The datetime precision with zero should be dumped · 18e0ffe9
      Ryuta Kamizono 提交于
      `precision: 0` was not dumped by f1a0fa9e.
      However, `precision: 0` is valid value for PostgreSQL timestamps.
      18e0ffe9
    • S
      Refactor microsecond precision to be database agnostic · f1a0fa9e
      Sean Griffin 提交于
      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.
      f1a0fa9e
  29. 08 2月, 2015 2 次提交