Sha256: 53361be4a46e676163b270c795f65613994f0b0da4d9d1d51066a1c19b10384e

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

class AddCategoryColumnToTemplates < ActiveRecord::Migration
  def change
    schema_name = "#{Landable.configuration.database_schema_prefix}landable"

    # add category_id to our templates table.
    add_column "#{schema_name}.templates", :category_id, :uuid
    execute "ALTER TABLE #{schema_name}.templates ADD FOREIGN KEY (category_id) REFERENCES #{schema_name}.categories(category_id)"

    # add category_id to our template_revisions table.
    add_column "#{schema_name}.template_revisions", :category_id, :uuid
    execute "ALTER TABLE #{schema_name}.template_revisions ADD FOREIGN KEY (category_id) REFERENCES #{schema_name}.categories(category_id)"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
landable-1.14.0 db/migrate/20150728195345_add_category_column_to_templates.rb