Skip to content

Commit

Permalink
Merge pull request #26 from tsanchev/patch-2
Browse files Browse the repository at this point in the history
table prefix
  • Loading branch information
Sammaye authored Oct 2, 2019
2 parents 26d3b6f + a9e98c1 commit e5fcf90
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions migrations/m150321_222228_audit_trail.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function up()
//table from version 1 of the extension. Other migrations will
//upgrade it from here if we ever need to. This was done so
//that older versions can still use migrate functionality to upgrade.
$this->createTable('tbl_audit_trail',
$this->createTable('{{%audit_trail}}',
[
'id' => Schema::TYPE_PK,
'old_value' => Schema::TYPE_TEXT,
Expand All @@ -27,20 +27,20 @@ public function up()
);

//Index these bad boys for speedy lookups
$this->createIndex( 'idx_audit_trail_user_id', 'tbl_audit_trail', 'user_id');
$this->createIndex( 'idx_audit_trail_model_id', 'tbl_audit_trail', 'model_id');
$this->createIndex( 'idx_audit_trail_model', 'tbl_audit_trail', 'model');
$this->createIndex( 'idx_audit_trail_field', 'tbl_audit_trail', 'field');
$this->createIndex( 'idx_audit_trail_user_id', '{{%audit_trail}}', 'user_id');
$this->createIndex( 'idx_audit_trail_model_id', '{{%audit_trail}}', 'model_id');
$this->createIndex( 'idx_audit_trail_model', '{{%audit_trail}}', 'model');
$this->createIndex( 'idx_audit_trail_field', '{{%audit_trail}}', 'field');
/* http://stackoverflow.com/a/1827099/383478
$this->createIndex( 'idx_audit_trail_old_value', 'tbl_audit_trail', 'old_value');
$this->createIndex( 'idx_audit_trail_new_value', 'tbl_audit_trail', 'new_value');
$this->createIndex( 'idx_audit_trail_old_value', '{{%audit_trail}}', 'old_value');
$this->createIndex( 'idx_audit_trail_new_value', '{{%audit_trail}}', 'new_value');
*/
$this->createIndex( 'idx_audit_trail_action', 'tbl_audit_trail', 'action');
$this->createIndex( 'idx_audit_trail_action', '{{%audit_trail}}', 'action');
}

public function down()
{
$this->dropTable( 'tbl_audit_trail' );
$this->dropTable( '{{%audit_trail}}' );
}

// Use safeUp/safeDown to run migration code within a transaction
Expand Down

0 comments on commit e5fcf90

Please sign in to comment.