|
|
@@ -577,6 +577,23 @@ class Table
|
|
|
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.
|
|
|
*
|