1. 04 4月, 2014 1 次提交
    • Y
      PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss & Yves Senn] · f4226c3a
      Yves Senn 提交于
      There is no reason for the PG adapter to have a default limit of 255 on :string
      columns. See this snippet from the PG docs:
      
          Tip: There is no performance difference among these three types, apart
          from increased storage space when using the blank-padded type, and a
          few extra CPU cycles to check the length when storing into a
          length-constrained column. While character(n) has performance
          advantages in some other database systems, there is no such advantage
          in PostgreSQL; in fact character(n) is usually the slowest of the
          three because of its additional storage costs. In most situations text
          or character varying should be used instead.
      f4226c3a
  2. 02 4月, 2014 1 次提交
    • J
      Clarify 'database does not exist' message and implementation. · 9aa7c25c
      Jeremy Kemper 提交于
      * Clarify what the situation is and what to do.
      * Advise loading schema using `rake db:setup` instead of migrating.
      * Use a rescue in the initializer rather than extending the error
        message in-place.
      * Preserve the original backtrace of other errors by using `raise`
        rather than raising again with `raise error`.
      
      References 0ec45cd1
      9aa7c25c
  3. 31 1月, 2014 1 次提交
    • A
      Fix regression on `.select_*` methods. · b7fcad8f
      Arthur Neves 提交于
      This was a common pattern:
      ```
      query = author.posts.select(:title)
      connection.select_one(query)
      ```
      
      However `.select` returns a ActiveRecord::AssociationRelation, which has
      the bind information, so we can use that to get the right sql query.
      
      Also fix select_rows on postgress and sqlite3 that were not using the binds
      
      [fixes #7538]
      [fixes #12017]
      [related #13731]
      [related #12056]
      b7fcad8f
  4. 18 1月, 2014 1 次提交
  5. 15 1月, 2014 1 次提交
  6. 14 1月, 2014 2 次提交
  7. 24 12月, 2013 1 次提交
  8. 12 12月, 2013 1 次提交
  9. 12 11月, 2013 2 次提交
  10. 10 11月, 2013 1 次提交
  11. 09 11月, 2013 1 次提交
    • Y
      log bind variables after they were type casted. · 97f0d9a0
      Yves Senn 提交于
      The log output used to be confusing in situation where type casting has
      "unexpected" effects. For example when finding records with a `String`.
      
      BEFORE:
      
      irb(main):002:0> Event.find("im-no-integer")
      D, [2013-11-09T11:10:28.998857 #1706] DEBUG -- :   Event Load (4.5ms)  SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1  [["id", "im-no-integer"]]
      
      AFTER:
      
      irb(main):002:0> Event.find("im-no-integer")
      D, [2013-11-09T11:10:28.998857 #1706] DEBUG -- :   Event Load (4.5ms)  SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1  [["id", 0]]
      97f0d9a0
  12. 14 10月, 2013 1 次提交
  13. 30 9月, 2013 2 次提交
  14. 12 9月, 2013 1 次提交
    • R
      Check if the SQL is not a prepared statement · f13b2785
      Rafael Mendonça França 提交于
      When the adapter is with prepared statement disabled and the binds array
      is not empty the connection adapter will try to set the binds values and
      will fail. Now we are checking if the adapter has the prepared statement
      disabled.
      
      Fixes #12023
      f13b2785
  15. 11 8月, 2013 1 次提交
  16. 09 8月, 2013 1 次提交
  17. 06 8月, 2013 2 次提交
  18. 29 3月, 2013 1 次提交
  19. 26 3月, 2013 1 次提交
  20. 23 3月, 2013 1 次提交
  21. 16 3月, 2013 1 次提交
  22. 12 3月, 2013 1 次提交
  23. 08 3月, 2013 1 次提交
  24. 25 2月, 2013 1 次提交
  25. 21 2月, 2013 3 次提交
    • Y
      also rename indexes when a table or column is renamed · 39eef1a5
      Yves Senn 提交于
      When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
      39eef1a5
    • Y
      reserve less chars for internal sqlite3 operations · 72ca2d7f
      Yves Senn 提交于
      72ca2d7f
    • Y
      reserve index name chars for internal rails operations · cca43528
      Yves Senn 提交于
      Some adapter (SQLite3) need to perform renaming operations to support
      the rails DDL. These rename prefixes operate with prefixes. When an
      index name already uses up the full space provieded by
      `index_name_length` these internal operations will fail. This patch
      introduces `allowed_index_name_length` which respects the amount of
      characters used for internal operations. It will always be <=
      `index_name_length` and every adapter can define how many characters
      need to be reserved.
      cca43528
  26. 16 2月, 2013 2 次提交
  27. 14 2月, 2013 1 次提交
  28. 12 2月, 2013 1 次提交
  29. 27 1月, 2013 1 次提交
    • D
      Fix cases where delete_records on a has_many association caused errors · 0a71c7b8
      Derek Kraan 提交于
      because of an ambiguous column name. This happened if the association
      model had a default scope that referenced a third table, and the third
      table also referenced the original table (with an identical
      foreign_key).
      
      Mysql requires that ambiguous columns are deambiguated by using the full
      table.column syntax. Postgresql and Sqlite use a different syntax for
      updates altogether (and don't tolerate table.name syntax), so the fix
      requires always including the full table.column and discarding it later
      for Sqlite and Postgresql.
      0a71c7b8
  30. 22 12月, 2012 1 次提交
  31. 19 12月, 2012 1 次提交
  32. 29 10月, 2012 2 次提交