Files
nairobi/db/migrate/20170720092638_create_documents.rb
taitus 574a5d0067 Update old migrations to maintain consistency
After merge "Bump paperclip from 5.2.1 to 6.1.0 #3905" as indicated in
the release_notes columns type for attachments are changed from integer
to bigint.
For this reason we edit old migrations so that they continue to
generate integer as before.
2020-09-08 11:00:19 +02:00

18 lines
552 B
Ruby

class CreateDocuments < ActiveRecord::Migration[4.2]
def change
create_table :documents do |t|
t.string :title
t.string :attachment_file_name
t.string :attachment_content_type
t.integer :attachment_file_size
t.datetime :attachment_updated_at
t.references :user, index: true, foreign_key: true
t.references :documentable, polymorphic: true, index: true
t.timestamps null: false
end
add_index :documents, [:user_id, :documentable_type, :documentable_id], name: "access_documents"
end
end