Sha256: e5c6164dd55c3e85fba0813ab77528f3af6814769ccab1bdce73197422d990c6

Contents?: true

Size: 1.45 KB

Versions: 200

Compression:

Stored size: 1.45 KB

Contents

class AddVersionOstreeBranches < ActiveRecord::Migration[4.2]
  def up
    drop_table :katello_ostree_branches if ActiveRecord::Base.connection.table_exists? "katello_ostree_branches"

    create_table :katello_ostree_branches do |t|
      t.string :version, :limit => 255
      t.string :name, :limit => 255
      t.string :uuid, :null => false, :limit => 255
      t.string :commit, :limit => 255
      t.timestamp :version_date
      t.timestamps
    end

    create_table :katello_repository_ostree_branches do |t|
      t.references :ostree_branch, :null => false
      t.references :repository, :null => true
      t.timestamps
    end

    add_index :katello_repository_ostree_branches, [:ostree_branch_id, :repository_id],
              :name => :katello_repo_ostree_branch_repo_id, :unique => true

    add_foreign_key :katello_repository_ostree_branches, :katello_repositories,
                    :column => :repository_id
  end

  def down
    drop_table :katello_repository_ostree_branches
    drop_table :katello_ostree_branches
    create_table :katello_ostree_branches do |t|
      t.string :name, :null => false, :limits => 255
      t.references :repository, :null => false
      t.timestamps
    end

    add_index :katello_ostree_branches, [:repository_id],
              :name => :index_branches_on_repository

    add_index :katello_ostree_branches, [:repository_id, :name],
              :name => :katello_ostree_branches_repo_branch, :unique => true
  end
end

Version data entries

200 entries across 200 versions & 1 rubygems

Version Path
katello-4.16.0 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.15.1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.16.0.rc2 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.16.0.rc1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.3 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.2 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.15.0 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.15.0.rc2 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.15.0.rc1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.0 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.0.rc3 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.0.rc2 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.0.rc1.1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.14.0.rc1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.13.1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.13.0 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.12.1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.13.0.rc1 db/migrate/20160301070319_add_version_ostree_branches.rb
katello-4.12.0 db/migrate/20160301070319_add_version_ostree_branches.rb