Sha256: 3eeca450eec2209f1d8cbf4cca3b31136c56b0ac46c998e683613ad1d91c5777

Contents?: true

Size: 634 Bytes

Versions: 5

Compression:

Stored size: 634 Bytes

Contents

Sequel.migration do

  up do
    length = case self.adapter_scheme
    when :mysql, :mysql2
      # http://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes/1814594#1814594
      # reasons to move away from mysql...
      255
    else
      2048
    end

    [:content, :spontaneous_content_archive, :spontaneous_content_history].each do |table|
      set_column_type table, :path, "varchar(#{length})"
    end
  end

  down do
    [:content, :spontaneous_content_archive, :spontaneous_content_history].each do |table|
      set_column_type table, :path, 'varchar(255)'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 db/migrations/20130813111009_increase_path_length.rb
spontaneous-0.2.0.beta9 db/migrations/20130813111009_increase_path_length.rb
spontaneous-0.2.0.beta8 db/migrations/20130813111009_increase_path_length.rb
spontaneous-0.2.0.beta7 db/migrations/20130813111009_increase_path_length.rb
spontaneous-0.2.0.beta6 db/migrations/20130813111009_increase_path_length.rb