diff --git a/app/models/attachment.rb b/app/models/attachment.rb index ae23428f1..f08bcdddf 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -519,6 +519,10 @@ class Attachment < ActiveRecord::Base end end + #更新文件的版本 + def update_attchment_version + end + private # Physically deletes the file from the file system diff --git a/app/models/attachment_history.rb b/app/models/attachment_history.rb index 4ff1ddd0d..2160d242d 100644 --- a/app/models/attachment_history.rb +++ b/app/models/attachment_history.rb @@ -1,3 +1,3 @@ class AttachmentHistory < ActiveRecord::Base - belongs_to :attachment,foreign_key: 'attach_id' + belongs_to :attachment,foreign_key: 'attachment_id' end diff --git a/db/migrate/20151230022443_rename_attachment_histories_column_version_id_to_attachment_id.rb b/db/migrate/20151230022443_rename_attachment_histories_column_version_id_to_attachment_id.rb new file mode 100644 index 000000000..15d0837d3 --- /dev/null +++ b/db/migrate/20151230022443_rename_attachment_histories_column_version_id_to_attachment_id.rb @@ -0,0 +1,8 @@ +class RenameAttachmentHistoriesColumnVersionIdToAttachmentId < ActiveRecord::Migration + def up + rename_column :attachment_histories,:version_id,:attachment_id + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 8e9bff4e2..374b44abf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151229045505) do +ActiveRecord::Schema.define(:version => 20151230022443) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -98,7 +98,7 @@ ActiveRecord::Schema.define(:version => 20151229045505) do t.integer "copy_from" t.integer "quotes" t.integer "version" - t.integer "version_id" + t.integer "attachment_id" end create_table "attachments", :force => true do |t|