Atualizar 'src/DDLWrapper/Db/Table.php'

This commit is contained in:
ahwelp
2019-01-02 03:42:35 +00:00
parent ffd543561e
commit 4a8316e390
+17
View File
@@ -577,6 +577,23 @@ class Table
return $this; return $this;
} }
/**
* Add deleted_at column to the table.
*
* @param string $deletedAtColumnName
*
* @return Table
*/
public function addSoftDelete($deletedAtColumnName = 'deleted_at'){
$deletedAtColumnName = is_null($deletedAtColumnName) ? 'deleted_at' : $deletedAtColumnName;
$this->addColumn($createdAtColumnName, 'timestamp', array(
'default' => 'null',
'null' => true,
));
return $this;
}
/** /**
* Insert data into the table. * Insert data into the table.
* *