Sha256: 0c4a93a85f3602b24282f38632bbd4b371e3780865f21e4aea82beea29c692ef

Contents?: true

Size: 852 Bytes

Versions: 6

Compression:

Stored size: 852 Bytes

Contents

class V3MigrationFields < ActiveRecord::Migration[5.0]
  def change
    add_column :cas_sites, :slug, :string
    add_column :cas_users, :metadata, :jsonb, default: {}
    add_column :cas_media_files, :cover, :boolean, null: false, default: false
    add_column :cas_media_files, :order, :integer, default: 1
    add_column :cas_media_files, :text, :text
    add_column :cas_media_files, :metadata, :jsonb, default: {}

    reversible do |dir|
      dir.up   do
        change_column :cas_users,
          :email,
          :string,
          null: true,
          default: nil
        change_column :cas_media_files,
          :author_id,
          :uuid,
          null: true
      end
      dir.down do
      end
    end

    add_index :cas_sites, :slug
    add_index :cas_users, :encrypted_password
    add_index :cas_media_files, :cover
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cas-cms-1.0.0.alpha2 db/migrate/20170618014204_v3_migration_fields.rb
cas-cms-1.0.0.alpha1 db/migrate/20170618014204_v3_migration_fields.rb
cas-cms-0.1.3 db/migrate/20170618014204_v3_migration_fields.rb
cas-cms-0.1.2 db/migrate/20170618014204_v3_migration_fields.rb
cas-cms-0.1.1 db/migrate/20170618014204_v3_migration_fields.rb
cas-cms-0.1.0 db/migrate/20170618014204_v3_migration_fields.rb