Skip to content

Commit

Permalink
Merge pull request #2394 from the-events-calendar/task/update-stellar…
Browse files Browse the repository at this point in the history
…wp/schema-version

Update schema version to latest
  • Loading branch information
Camwyn authored Feb 13, 2025
2 parents 7cbcce9 + 4fea160 commit abca087
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"stellarwp/db": "^1.0.3",
"stellarwp/installer": "^1.1.0",
"stellarwp/models": "dev-main",
"stellarwp/schema": "^1.1.3",
"stellarwp/schema": "^1.1.8",
"stellarwp/telemetry": "^2.3.1",
"stellarwp/assets": "1.4.2",
"stellarwp/admin-notices": "^1.1",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions src/Common/Integrations/Custom_Table_Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,4 @@ protected function check_and_add_index( array $results, string $index_name, stri

return $results;
}

/**
* Empties the custom table in a way that is not causing an implicit commit.
*
* Even though the method is called truncate it doesn't use TRUNCATE.
* Thats because we want to avoid implicit commits in the DB making this method suitable for using during a testcase.
* If you want to use TRUNCATE you can use the `empty_table` method instead.
*
* @since TBD
*
* @return bool|int Whether it was emptied or not.
*/
public function truncate() {
DB::query( 'SET FOREIGN_KEY_CHECKS = 0;' );
$deleted = DB::query(
DB::prepare(
'DELETE FROM %i',
static::table_name( true )
)
);
DB::query( 'SET FOREIGN_KEY_CHECKS = 1;' );

return is_numeric( $deleted );
}
}

0 comments on commit abca087

Please sign in to comment.