Sha256: 2b2d111d70b5844ce1c6e8cdc304ea488a8648aa954779fc0e393ab79223d7cf

Contents?: true

Size: 404 Bytes

Versions: 15

Compression:

Stored size: 404 Bytes

Contents

class CreateSmithyAssetSources < ActiveRecord::Migration
  def change
    create_table :smithy_asset_sources do |t|
      t.string :name

      t.timestamps
    end

    add_reference :smithy_assets, :asset_source, index: true

    default_source = Smithy::AssetSource.find_or_create_by(name: "Default")
    Smithy::Asset.where(asset_source: nil).update_all(asset_source_id: default_source.id)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
smithycms-0.8.1 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.7.3 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.7.2 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.7.1 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.7.0 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.10 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.9 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.7 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.6 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.5 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.4 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.3 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.2 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.1 db/migrate/20160122152402_create_smithy_asset_sources.rb
smithycms-0.6.0 db/migrate/20160122152402_create_smithy_asset_sources.rb