mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
Restore versions
DB table and add learning tests
This commit is contained in:
parent
5c8e507b93
commit
647bf4c397
5 changed files with 84 additions and 8 deletions
15
db/migrate/20190302091059_restore_versions.rb
Normal file
15
db/migrate/20190302091059_restore_versions.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class RestoreVersions < ActiveRecord::Migration
|
||||
def change
|
||||
drop_table :versions
|
||||
|
||||
create_table :versions do |t|
|
||||
t.string :item_type, :null => false
|
||||
t.integer :item_id, :null => false
|
||||
t.string :event, :null => false
|
||||
t.string :whodunnit
|
||||
t.text :object
|
||||
t.datetime :created_at
|
||||
end
|
||||
add_index :versions, [:item_type, :item_id]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddObjectChangesToVersions < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :versions, :object_changes, :jsonb
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue