Skip to content

Commit

Permalink
Merge pull request #3843 from BacLuc/api-enable-savepoints
Browse files Browse the repository at this point in the history
api: enable savepoints for transactions
  • Loading branch information
usu committed Sep 28, 2023
2 parents eef7425 + 07e1a30 commit 38927c3
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 30 deletions.
1 change: 1 addition & 0 deletions api/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ doctrine:
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
server_version: '15.0'
use_savepoints: true
types:
datetime: App\Types\Doctrine\UTCDateTimeType
date: App\Types\Doctrine\UTCDateType
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Activities/ListActivitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activities');

$this->assertSqlQueryCount($client, 19);
$this->assertSqlQueryCount($client, 21);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Activities/ReadActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activities/'.$activity->getId());

$this->assertSqlQueryCount($client, 29);
$this->assertSqlQueryCount($client, 31);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activity_progress_labels');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activity_progress_labels/'.$activityProgressLabel->getId());

$this->assertSqlQueryCount($client, 5);
$this->assertSqlQueryCount($client, 7);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activity_responsibles');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/activity_responsibles/'.$activityResponsible->getId());

$this->assertSqlQueryCount($client, 6);
$this->assertSqlQueryCount($client, 8);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/camp_collaborations');

$this->assertSqlQueryCount($client, 23);
$this->assertSqlQueryCount($client, 25);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/camp_collaborations/'.$campCollaboration->getId());

$this->assertSqlQueryCount($client, 13);
$this->assertSqlQueryCount($client, 15);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Camps/ListCampsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/camps');

$this->assertSqlQueryCount($client, 27);
$this->assertSqlQueryCount($client, 29);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Camps/ReadCampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/camps/'.$camp->getId());

$this->assertSqlQueryCount($client, 26);
$this->assertSqlQueryCount($client, 28);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Categories/ListCategoriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/categories');

$this->assertSqlQueryCount($client, 9);
$this->assertSqlQueryCount($client, 11);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Categories/ReadCategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/categories/'.$category->getId());

$this->assertSqlQueryCount($client, 7);
$this->assertSqlQueryCount($client, 9);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/ContentTypes/ListContentTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/content_types');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/ContentTypes/ReadContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/content_types/'.$contentType->getId());

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/DayResponsibles/ListDayResponsiblesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/day_responsibles');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/DayResponsibles/ReadDayResponsibleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/day_responsibles/'.$dayResponsible->getId());

$this->assertSqlQueryCount($client, 7);
$this->assertSqlQueryCount($client, 9);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Days/ListDaysTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/days');

$this->assertSqlQueryCount($client, 15);
$this->assertSqlQueryCount($client, 17);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Days/ReadDayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/days/'.$day->getId());

$this->assertSqlQueryCount($client, 9);
$this->assertSqlQueryCount($client, 11);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/MaterialItems/ListMaterialItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/material_items');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/MaterialItems/ReadMaterialItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/material_items/'.$materialItem->getId());

$this->assertSqlQueryCount($client, 6);
$this->assertSqlQueryCount($client, 8);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/MaterialLists/ListMaterialListsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/material_lists');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/MaterialLists/ReadMaterialListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/material_lists/'.$materialList->getId());

$this->assertSqlQueryCount($client, 5);
$this->assertSqlQueryCount($client, 7);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Periods/ListPeriodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/periods');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Periods/ReadPeriodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/periods/'.$period->getId());

$this->assertSqlQueryCount($client, 17);
$this->assertSqlQueryCount($client, 19);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Profiles/ListProfilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/profiles');

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Profiles/ReadProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/profiles/'.$profile->getId());

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/ScheduleEntries/ListScheduleEntriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/schedule_entries');

$this->assertSqlQueryCount($client, 21);
$this->assertSqlQueryCount($client, 23);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/ScheduleEntries/ReadScheduleEntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/schedule_entries/'.$scheduleEntry->getId());

$this->assertSqlQueryCount($client, 17);
$this->assertSqlQueryCount($client, 19);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Users/ListUsersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/users');

$this->assertSqlQueryCount($client, 20);
$this->assertSqlQueryCount($client, 22);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/Users/ReadUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ public function testSqlQueryCount() {
$client->enableProfiler();
$client->request('GET', '/users/'.$user->getId());

$this->assertSqlQueryCount($client, 4);
$this->assertSqlQueryCount($client, 6);
}
}

0 comments on commit 38927c3

Please sign in to comment.