-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate data from the old table to the new one
- Loading branch information
1 parent
02e1d3e
commit 006d44d
Showing
5 changed files
with
24 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class MergeAuditTables < ActiveRecord::Migration[5.1] | ||
def self.up | ||
execute 'INSERT INTO audits(auditable_id, auditable_type, user_id, user_type, action, audited_changes, version, comment, remote_address, created_at) ' \ | ||
'SELECT auditable_id, auditable_type, user_id, user_type, action, audited_changes, version, comment, remote_address, created_at FROM espinita_audits;' | ||
drop_table :espinita_audits | ||
end | ||
|
||
def self.down | ||
raise IrreversibleMigration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters