You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
504 B

class CreateAnnotationDocuments < ActiveRecord::Migration[6.1]
def change
create_table :annotation_documents do |t|
t.references :annotation, null: false
t.references :document, null: false, polymorphic: true
t.integer :rank, null: false, default: 1
t.timestamps
end
add_index :annotation_documents,
%i[annotation_id document_id document_type],
name: "index_annotation_documents_uniqueness",
unique: true
end
end