debian-mirror-gitlab/db/migrate/20200206112850_create_snippet_repository_table.rb

16 lines
599 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# frozen_string_literal: true
class CreateSnippetRepositoryTable < ActiveRecord::Migration[6.0]
DOWNTIME = false
2020-05-24 23:13:21 +05:30
# rubocop:disable Migration/PreventStrings
2020-03-09 13:42:32 +05:30
def change
create_table :snippet_repositories, id: false, primary_key: :snippet_id do |t|
t.references :shard, null: false, index: true, foreign_key: { on_delete: :restrict }
t.references :snippet, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade }
t.string :disk_path, limit: 80, null: false, index: { unique: true }
end
end
2020-05-24 23:13:21 +05:30
# rubocop:enable Migration/PreventStrings
2020-03-09 13:42:32 +05:30
end