mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-02-28 16:53:23 -05:00
Adding acts_as_loggable migrations
This commit is contained in:
parent
f5be9ca6ff
commit
ea8dd6842c
25
db/migrate/20121204220660_acts_as_loggable_migration.rb
Normal file
25
db/migrate/20121204220660_acts_as_loggable_migration.rb
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
class ActsAsLoggableMigration < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
create_table :logs do |t|
|
||||||
|
t.references :loggable, :polymorphic => true
|
||||||
|
t.references :logger, :polymorphic => true
|
||||||
|
|
||||||
|
t.string :context, :limit => 128
|
||||||
|
|
||||||
|
t.datetime "start_date", :null => false
|
||||||
|
t.datetime "end_date", :null => false
|
||||||
|
|
||||||
|
t.text :description, :default => ""
|
||||||
|
t.integer :action_id, :default => 0
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index :logs, [:loggable_id, :loggable_type, :context]
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :logs
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
class ActsAsLoggableBikeActionsMigration < ActiveRecord::Migration
|
||||||
|
|
||||||
|
def self.up
|
||||||
|
create_table :bike_actions do |t|
|
||||||
|
t.string :action, :limit => 128
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :bike_actions
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
class ActsAsLoggableUserActionsMigration < ActiveRecord::Migration
|
||||||
|
|
||||||
|
def self.up
|
||||||
|
create_table :user_actions do |t|
|
||||||
|
t.string :action, :limit => 128
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :user_actions
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
class ActsAsLoggableTransactionActionsMigration < ActiveRecord::Migration
|
||||||
|
|
||||||
|
def self.up
|
||||||
|
create_table :transaction_actions do |t|
|
||||||
|
t.string :action, :limit => 128
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :transaction_actions
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user