2019-02-15 15:39:39 +05:30
|
|
|
class CreateNotesDiffFiles < ActiveRecord::Migration[4.2]
|
2018-11-08 19:23:39 +05:30
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:disable Migration/AddLimitToTextColumns
|
|
|
|
# rubocop:disable Migration/PreventStrings
|
2018-11-08 19:23:39 +05:30
|
|
|
def change
|
|
|
|
create_table :note_diff_files do |t|
|
|
|
|
t.references :diff_note, references: :notes, null: false, index: { unique: true }
|
|
|
|
t.text :diff, null: false
|
|
|
|
t.boolean :new_file, null: false
|
|
|
|
t.boolean :renamed_file, null: false
|
|
|
|
t.boolean :deleted_file, null: false
|
|
|
|
t.string :a_mode, null: false
|
|
|
|
t.string :b_mode, null: false
|
|
|
|
t.text :new_path, null: false
|
|
|
|
t.text :old_path, null: false
|
|
|
|
end
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
# rubocop:disable Migration/AddConcurrentForeignKey
|
2018-11-08 19:23:39 +05:30
|
|
|
add_foreign_key :note_diff_files, :notes, column: :diff_note_id, on_delete: :cascade
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:enable Migration/AddConcurrentForeignKey
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:enable Migration/PreventStrings
|
|
|
|
# rubocop:enable Migration/AddLimitToTextColumns
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|