2018-11-13 02:27:31 -05:00
|
|
|
class CreateBadges < ActiveRecord::Migration[4.2]
|
2018-03-05 12:51:40 -05:00
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
2019-08-23 17:36:12 -04:00
|
|
|
# rubocop:disable Migration/AddLimitToStringColumns
|
2018-03-05 12:51:40 -05:00
|
|
|
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
|
2019-08-23 17:36:12 -04:00
|
|
|
# rubocop:enable Migration/AddLimitToStringColumns
|
2018-03-05 12:51:40 -05:00
|
|
|
|
2018-07-25 04:59:23 -04:00
|
|
|
# rubocop:disable Migration/AddConcurrentForeignKey
|
2018-03-05 12:51:40 -05:00
|
|
|
add_foreign_key :badges, :namespaces, column: :group_id, on_delete: :cascade
|
|
|
|
end
|
|
|
|
end
|