If your plugin contains DB migrations that add string columns, read on.
A change (#13897) was merged to Foreman itself to add explicit limits of
255 characters to all string columns, and I'd recommend that plugins do
the same.
In Rails 4.2 the default limit for PostgreSQL and SQLite adapters
changes to unlimited from 255 characters. MySQL remains at 255 chars.
Existing migrations should be changed to specify the length, e.g.
t.column :name, :string, :null => false, :limit => 255
This will ensure that the schema generated on a new installation exactly
matches the schema from an old installation, so there won't be varying
versions of the schema in the wild.
If you'd like to actually make use of the bigger columns, create a new
migration as well to extend the length. Note that MySQL's VARCHAR
column type is limited to 255 chars, so either change it to a text
column or accept that the behaviour will differ between DBs.
···
--
Dominic Cleal
dominic@cleal.org
I’ve opened a PR for Katello:
https://github.com/Katello/katello/pull/5837
David
···
On Wed, Mar 2, 2016 at 10:08 AM, Dominic Cleal wrote:
If your plugin contains DB migrations that add string columns, read on.
A change (#13897) was merged to Foreman itself to add explicit limits of
255 characters to all string columns, and I’d recommend that plugins do
the same.
In Rails 4.2 the default limit for PostgreSQL and SQLite adapters
changes to unlimited from 255 characters. MySQL remains at 255 chars.
Existing migrations should be changed to specify the length, e.g.
t.column :name, :string, :null => false, :limit => 255
This will ensure that the schema generated on a new installation exactly
matches the schema from an old installation, so there won’t be varying
versions of the schema in the wild.
If you’d like to actually make use of the bigger columns, create a new
migration as well to extend the length. Note that MySQL’s VARCHAR
column type is limited to 255 chars, so either change it to a text
column or accept that the behaviour will differ between DBs.
–
Dominic Cleal
dominic@cleal.org
–
You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.