-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres Schema adapter ignores limit argument for binary columns #29922
Comments
PostgreSQL doesn't support limit for binary columns |
Can we update the docs to not be confusing then? |
The docs do explicitly say "This is the number of bytes for binary columns". We should probably just not list the types affected by it explicitly, or at least mention "this field is ignored by some backends" since I don't think there is any type we support for which postgres will actually apply a limit. |
lugray
pushed a commit
to lugray/rails
that referenced
this issue
Jul 25, 2017
The limit option is ignored by PostgreSQL and may be ignored by 3rd party backends. Make this clear in the docs. Fixes rails#29922.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Create this migration:
Expected behavior
db/schema.rb should show that the column has a size limit, and the column should actually have that limit.
http://api.rubyonrails.org/v5.1.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_column states:
:limit - Requests a maximum column length. This is the number of characters for a :string column and number of bytes for :text, :binary and :integer columns
, so it should be valid for a binary type.Actual behavior
The limit argument is not passed along to the CREATE command. It does not show up in the db/schema.rb file, and I can create records with more than 1 MB in the column.
System configuration
Rails version: 5.1.2
Ruby version: 2.4.0
The text was updated successfully, but these errors were encountered: