Sha256: 7fa9e68c5fe24dc921c1b1061e8f9edca001025751c1731e9252810e380b05f0

Contents?: true

Size: 1.42 KB

Versions: 29

Compression:

Stored size: 1.42 KB

Contents

class SchemaConstraintsCleanup < ActiveRecord::Migration[4.2]
  # Set reasonable size limit to a bunch of indexed string columns. They were defaulted to 255
  def change
    change_column :github_hooks, :event, :string, limit: 50, null: false # The biggest existing event is 27
    change_column :github_hooks, :organization, :string, limit: 39 # https://github.com/Shopify/shipit-engine/blob/d9aa8d54902de9ab3bd1ea4503003cca7df5d431/app/models/stack.rb#L4

    change_column :stacks, :repo_name, :string, limit: 100, null: false # https://github.com/Shopify/shipit-engine/blob/d9aa8d54902de9ab3bd1ea4503003cca7df5d431/app/models/stack.rb#L5
    change_column :stacks, :repo_owner, :string, limit: 39, null: false # https://github.com/Shopify/shipit-engine/blob/d9aa8d54902de9ab3bd1ea4503003cca7df5d431/app/models/stack.rb#L4
    change_column :stacks, :environment, :string, limit: 50, null: false, default: 'production'

    change_column :tasks, :status, :string, limit: 10, null: false, default: 'pending'

    change_column :teams, :organization, :string, limit: 39 # https://github.com/Shopify/shipit-engine/blob/d9aa8d54902de9ab3bd1ea4503003cca7df5d431/app/models/stack.rb#L4
    change_column :teams, :slug, :string, limit: 50 # No real limit GH side AFAICT, but come on...

    change_column :users, :login, :string, limit: 39 # https://github.com/Shopify/shipit-engine/blob/d9aa8d54902de9ab3bd1ea4503003cca7df5d431/app/models/stack.rb#L4
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.38.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.37.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.36.1 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.36.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.35.1 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.35.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.34.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.33.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.32.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.31.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.30.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.29.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.28.1 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.28.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.27.1 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.27.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.26.0 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.25.1 db/migrate/20151102201634_schema_constraints_cleanup.rb
shipit-engine-0.25.0 db/migrate/20151102201634_schema_constraints_cleanup.rb