You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Same here... This is happening because of the PostgreSQL version.
For version 8.x, the syntax is ALTER COLUMN "column_name" VARCHAR(1 AND 255), and for version 9.x, the syntax is ALTER COLUMN "column_name" TYPE VARCHAR(1 AND 255).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My migration looks like:
migration 1, :modify_url_length do
up do
modify_table :hotels do
change_column :url, String, :length => 1..255
end
end
down do
modify_table :hotels do
change_column :url, String, :length => 1..255
end
end
end
However, the migration fails with the error: ERROR: syntax error at or near "VARCHAR".
Seems to me that the SQL being ran is:
ALTER TABLE "hotels" ALTER COLUMN "url" VARCHAR(1 AND 255)
when it needs to be
ALTER TABLE "hotels" ALTER COLUMN "url" TYPE VARCHAR(1 AND 255)
The text was updated successfully, but these errors were encountered: