fixing database connections
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Lucent\Revision;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Lucent\Database\Database;
|
||||
use Lucent\Edge\Edge;
|
||||
use Lucent\Primitive\Collection;
|
||||
use Lucent\Record\FileData;
|
||||
@@ -19,7 +19,7 @@ class RevisionRepo
|
||||
public function create(Revision $revision): string
|
||||
{
|
||||
$revisionDB = $this->toDB($revision);
|
||||
DB::table($this->table)->insert($revisionDB);
|
||||
Database::make()->table($this->table)->insert($revisionDB);
|
||||
return $revision->id;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class RevisionRepo
|
||||
**/
|
||||
public function getByRecordId(string $rid): Collection
|
||||
{
|
||||
$revisions = DB::table($this->table)
|
||||
$revisions = Database::make()->table($this->table)
|
||||
->where("recordId", $rid)
|
||||
->get()
|
||||
->map([$this, 'fromDB'])
|
||||
@@ -41,7 +41,7 @@ class RevisionRepo
|
||||
|
||||
public function cleanupRecord(string $rid, int $numKeep): void
|
||||
{
|
||||
$revisionIds = DB::table($this->table)
|
||||
$revisionIds = Database::make()->table($this->table)
|
||||
->where("recordId", $rid)
|
||||
->orderBy("_sys->version", "desc")
|
||||
->limit(100)
|
||||
@@ -49,7 +49,7 @@ class RevisionRepo
|
||||
->get()
|
||||
->pluck("id");
|
||||
|
||||
DB::table($this->table)
|
||||
Database::make()->table($this->table)
|
||||
->whereIn("id", $revisionIds)
|
||||
->delete();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class RevisionRepo
|
||||
public function getByRecordIdAndVersion(string $rid, int $version): Option
|
||||
{
|
||||
|
||||
$res = DB::table($this->table)
|
||||
$res = Database::make()->table($this->table)
|
||||
->where("recordId", $rid)
|
||||
->where('_sys->version', $version)->first();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user