Skip to content

Commit

Permalink
TASK: rename dirty to hasChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 1, 2024
1 parent 489db4c commit 2e5eb47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function getBasicWorkspaceQuery(): QueryBuilder
$queryBuilder = $this->dbal->createQueryBuilder();

return $queryBuilder
->select('ws.name, ws.baseWorkspaceName, ws.currentContentStreamId, cs.sourceContentStreamVersion = scs.version as upToDateWithBase, cs.dirty as workspaceHasChanges')
->select('ws.name, ws.baseWorkspaceName, ws.currentContentStreamId, cs.hasChanges, cs.sourceContentStreamVersion = scs.version as upToDateWithBase')
->from($this->tableNames->workspace(), 'ws')
->join('ws', $this->tableNames->contentStream(), 'cs', 'cs.id = ws.currentcontentstreamid')
->leftJoin('cs', $this->tableNames->contentStream(), 'scs', 'scs.id = cs.sourceContentStreamId');
Expand Down Expand Up @@ -190,7 +190,7 @@ private static function workspaceFromDatabaseRow(array $row): Workspace
$status,
$baseWorkspaceName === null
? false
: (bool)$row['workspaceHasChanges'],
: (bool)$row['hasChanges'],
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function createContentStreamTable(): Table
DbalSchemaFactory::columnForContentStreamId('sourceContentStreamId')->setNotnull(false),
(new Column('sourceContentStreamVersion', Type::getType(Types::INTEGER)))->setNotnull(false),
(new Column('closed', Type::getType(Types::BOOLEAN)))->setNotnull(true),
(new Column('dirty', Type::getType(Types::BOOLEAN)))->setNotnull(true),
(new Column('hasChanges', Type::getType(Types::BOOLEAN)))->setNotnull(true),
]);

return $contentStreamTable->setPrimaryKey(['id']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function createContentStream(ContentStreamId $contentStreamId, ?ContentS
'sourceContentStreamId' => $sourceContentStreamId?->value,
'sourceContentStreamVersion' => $sourceVersion?->value,
'closed' => 0,
'dirty' => 0
'hasChanges' => 0
]);
}

Expand Down Expand Up @@ -57,7 +57,7 @@ private function updateContentStreamVersion(ContentStreamId $contentStreamId, Ve
'version' => $version->value,
];
if ($markAsDirty) {
$updatePayload['dirty'] = 1;
$updatePayload['hasChanges'] = 1;
}
$this->dbal->update($this->tableNames->contentStream(), $updatePayload, [
'id' => $contentStreamId->value,
Expand Down

0 comments on commit 2e5eb47

Please sign in to comment.