mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Add versions table/model for prices
This commit is contained in:
parent
e03ae63acf
commit
86ea2319c8
5 changed files with 92 additions and 16 deletions
|
@ -1,6 +0,0 @@
|
|||
class RemovePaperTrailColumnsFromPrices < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :prices, :creator_str
|
||||
remove_column :prices, :updator_str
|
||||
end
|
||||
end
|
26
db/migrate/20200910102028_create_version_for_prices.rb
Normal file
26
db/migrate/20200910102028_create_version_for_prices.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
class CreateVersionForPrices < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
create_table :log_prices, force: :cascade do |t|
|
||||
t.string :item_type, null: false
|
||||
t.integer :item_id, null: false
|
||||
t.string :event, null: false
|
||||
t.string :whodunnit
|
||||
t.json :object
|
||||
t.json :object_changes
|
||||
t.datetime :created_at
|
||||
t.string :session
|
||||
t.json :children
|
||||
t.string :uuid
|
||||
end
|
||||
|
||||
add_index 'log_prices', ['item_type', 'item_id'], name: 'index_log_prices_on_item_type_and_item_id', using: :btree
|
||||
add_index 'log_prices', ['whodunnit'], name: 'index_log_prices_on_whodunnit', using: :btree
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :log_prices, name: 'index_log_prices_on_item_type_and_item_id'
|
||||
remove_index :log_prices, name: 'index_log_prices_on_whodunnit'
|
||||
|
||||
drop_table :log_prices
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue