Skip to content

Commit

Permalink
Rename isDisabled column to is_disabled
Browse files Browse the repository at this point in the history
This will avoid issues with PostgreSQL since it requires mixed case columns to be double quoted.
  • Loading branch information
theodorejb committed Oct 22, 2024
1 parent 987ee2a commit 3215b97
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/MssqlDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private static function createTestTable(PeachySql $db): void
name NVARCHAR(50) NOT NULL UNIQUE,
dob DATE NOT NULL,
weight FLOAT NOT NULL,
isDisabled BIT NOT NULL
is_disabled BIT NOT NULL
)";

$db->query($sql);
Expand Down
2 changes: 1 addition & 1 deletion test/MysqlDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static function createTestTable(PeachySql $db): void
name VARCHAR(50) NOT NULL UNIQUE,
dob DATE NOT NULL,
weight DOUBLE NOT NULL,
isDisabled BOOLEAN NOT NULL
is_disabled BOOLEAN NOT NULL
)";

$db->query($sql);
Expand Down
2 changes: 1 addition & 1 deletion test/src/LegacyUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function getMap(): array
'name' => 'name',
'birthday' => 'dob',
'weight' => 'weight',
'isDisabled' => 'isDisabled',
'isDisabled' => 'is_disabled',
];
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/ModernUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function getMap(): array
'name' => 'name',
'birthday' => 'dob',
'weight' => 'weight',
'isDisabled' => 'isDisabled',
'isDisabled' => 'is_disabled',
];
}

Expand All @@ -34,7 +34,7 @@ protected function getSelectProps(): array
return [
new Prop('id', 'u.user_id'),
new Prop('name', 'name', false, true, 'username'),
new Prop('isDisabled', 'isDisabled', false, true, '', 'bool'),
new Prop('isDisabled', 'is_disabled', false, true, '', 'bool'),
new Prop('computed', '', false, true, '', null, false, $getValue, ['weight']),
new Prop('thing.id', 'ut.thing_id', true),
new Prop('thing.uid', 'ut.user_id', false, true, 'thing_user'),
Expand Down
4 changes: 2 additions & 2 deletions test/src/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ protected function getMap(): array
'name' => 'name',
'birthday' => 'dob',
'weight' => 'weight',
'isDisabled' => 'isDisabled',
'isDisabled' => 'is_disabled',
];
}

protected function getSelectProps(): array
{
return [
new Prop('isDisabled', 'isDisabled', type: 'bool'),
new Prop('isDisabled', 'is_disabled', type: 'bool'),
];
}

Expand Down

0 comments on commit 3215b97

Please sign in to comment.