Skip to content

Commit

Permalink
update Drop class methods,covnert return void to self
Browse files Browse the repository at this point in the history
  • Loading branch information
BMTmohammedtaha committed Sep 26, 2023
1 parent e6aa523 commit fbf31e0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/Operations/Drop.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,68 +95,76 @@ public function index($name): self
/**
* Set the target to drop a database.
*/
public function dropDatabase(): void
public function dropDatabase(): self
{
$this->setAttribute('target', 'database');
return $this;
}

/**
* Set the target to drop a table.
*/
public function dropTable(): void
public function dropTable(): self
{
$this->setAttribute('target', 'table');
return $this;
}

/**
* Set the target to drop a column.
*/
public function dropColumn(): void
public function dropColumn(): self
{
$this->setAttribute('target', 'column');
return $this;
}

/**
* Set the target to drop a key.
*/
public function dropKey(): void
public function dropKey(): self
{
$this->setAttribute('target', 'key');
return $this;
}

/**
* Set the target to drop a primary key.
*/
public function dropPrimaryKey(): void
public function dropPrimaryKey(): self
{
$this->dropKey();
$this->setAttribute('type', 'primary_key');
return $this;
}

/**
* Set the target to drop a foreign key.
*/
public function dropForeignKey(): void
public function dropForeignKey(): self
{
$this->dropKey();
$this->setAttribute('type', 'foreign_key');
return $this;
}

/**
* Set the target to drop a unique key.
*/
public function dropUniqueKey(): void
public function dropUniqueKey(): self
{
$this->dropIndex();
$this->setAttribute('type', 'unique_key');
return $this;
}

/**
* Set the target to drop an index.
*/
public function dropIndex(): void
public function dropIndex(): self
{
$this->setAttribute('target', 'index');
return $this;
}

/**
Expand Down

0 comments on commit fbf31e0

Please sign in to comment.