debian-mirror-gitlab/db/migrate/20180214093516_create_badges.rb

22 lines
729 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
class CreateBadges < ActiveRecord::Migration[4.2]
2018-03-27 19:54:05 +05:30
DOWNTIME = false
2020-05-24 23:13:21 +05:30
# rubocop:disable Migration/PreventStrings
2018-03-27 19:54:05 +05:30
def change
create_table :badges do |t|
t.string :link_url, null: false
t.string :image_url, null: false
t.references :project, index: true, foreign_key: { on_delete: :cascade }, null: true
t.integer :group_id, index: true, null: true
t.string :type, null: false
t.timestamps_with_timezone null: false
end
2018-11-18 11:00:15 +05:30
# rubocop:disable Migration/AddConcurrentForeignKey
2018-03-27 19:54:05 +05:30
add_foreign_key :badges, :namespaces, column: :group_id, on_delete: :cascade
2020-05-24 23:13:21 +05:30
# rubocop:enable Migration/AddConcurrentForeignKey
2018-03-27 19:54:05 +05:30
end
2020-05-24 23:13:21 +05:30
# rubocop:enable Migration/PreventStrings
2018-03-27 19:54:05 +05:30
end