Skip to content

Commit

Permalink
v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AbmSourav committed Aug 3, 2023
1 parent cadb8a5 commit 12a154d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codesvault/howdy-qb",
"description": "Mysql Query Builder for WordPress",
"version": "1.5.1",
"version": "1.5.2",
"minimum-stability": "stable",
"scripts": {
"test": "phpunit",
Expand Down
2 changes: 2 additions & 0 deletions src/Api/CreateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function default($value): self;

public function foreignKey(string $column, string $reference_table, string $reference_column): self;

public function onDelete(string $action): self;

public function getSql();

public function execute();
Expand Down
7 changes: 6 additions & 1 deletion src/Statement/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace CodesVault\Howdyqb\Statement;

use CodesVault\Howdyqb\Api\CreateInterface;
use CodesVault\Howdyqb\QueryFactory;
use CodesVault\Howdyqb\SqlGenerator;
use CodesVault\Howdyqb\Utilities;

Expand Down Expand Up @@ -139,6 +138,12 @@ public function foreignKey(string $column, string $reference_table, string $refe
return $this;
}

public function onDelete(string $action): self
{
$this->sql['onDelete'] = "ON DELETE $action";
return $this;
}

protected function start()
{
$this->sql['start'] = 'CREATE TABLE IF NOT EXISTS';
Expand Down

0 comments on commit 12a154d

Please sign in to comment.