Skip to content

Commit 14da595

Browse files
committed
Use Doctrine\DBAL\Types\Types constants for SQL field definitions and ensure consistent schema adjustments.
1 parent e1f9201 commit 14da595

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/Resources/contao/dca/tl_content.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use Doctrine\DBAL\Types\Types;
56
use Hofff\Contao\Consent\Bridge\EventListener\Dca\ConsentIdOptions;
67
use Hofff\Contao\Consent\Bridge\EventListener\Dca\ContentDcaListener;
78

@@ -18,7 +19,7 @@
1819
'chosen' => true,
1920
'multiple' => false,
2021
],
21-
'sql' => ['type' => 'string', 'default' => null, 'notnull' => false],
22+
'sql' => ['type' => Types::STRING, 'length' => 255, 'default' => null, 'notnull' => false],
2223
];
2324

2425
$GLOBALS['TL_DCA']['tl_content']['fields']['hofff_consent_bridge_placeholder_template'] = [
@@ -30,5 +31,5 @@
3031
'chosen' => true,
3132
'multiple' => false,
3233
],
33-
'sql' => ['type' => 'string', 'length' => 255, 'default' => null, 'notnull' => false],
34+
'sql' => ['type' => Types::STRING, 'length' => 255, 'default' => null, 'notnull' => false],
3435
];

src/Resources/contao/dca/tl_module.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use Doctrine\DBAL\Types\Types;
56
use Hofff\Contao\Consent\Bridge\EventListener\Dca\ConsentIdOptions;
67
use Hofff\Contao\Consent\Bridge\EventListener\Dca\ModuleDcaListener;
78

@@ -20,7 +21,7 @@
2021
'chosen' => true,
2122
'multiple' => false,
2223
],
23-
'sql' => ['type' => 'string', 'default' => null, 'notnull' => false],
24+
'sql' => ['type' => Types::STRING, 'length' => 255, 'default' => null, 'notnull' => false],
2425
];
2526

2627
$GLOBALS['TL_DCA']['tl_module']['fields']['hofff_consent_bridge_placeholder_template'] = [
@@ -32,5 +33,5 @@
3233
'chosen' => true,
3334
'multiple' => false,
3435
],
35-
'sql' => ['type' => 'string', 'length' => 255, 'default' => null, 'notnull' => false],
36+
'sql' => ['type' => Types::STRING, 'length' => 255, 'default' => null, 'notnull' => false],
3637
];

src/Resources/contao/dca/tl_page.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use Doctrine\DBAL\Types\Types;
56
use Hofff\Contao\Consent\Bridge\EventListener\Dca\PageDcaListener;
67

78
$GLOBALS['TL_DCA']['tl_page']['fields']['hofff_consent_bridge_consent_tool'] = [
@@ -17,7 +18,8 @@
1718
'tl_class' => 'w50',
1819
],
1920
'sql' => [
20-
'type' => 'string',
21+
'type' => Types::STRING,
22+
'length' => 255,
2123
'notnull' => true,
2224
'default' => '',
2325
],

0 commit comments

Comments
 (0)