2020-02-13 10:08:52 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateSnippetRepositoryTable < ActiveRecord::Migration[6.0]
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2020-04-21 11:21:10 -04:00
|
|
|
# rubocop:disable Migration/PreventStrings
|
2020-02-13 10:08:52 -05:00
|
|
|
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-04-21 11:21:10 -04:00
|
|
|
# rubocop:enable Migration/PreventStrings
|
2020-02-13 10:08:52 -05:00
|
|
|
end
|