From 4793b258148761db9ed3dbf31efc030d4ec91342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Mummert?= Date: Sun, 21 Dec 2025 20:37:58 +0100 Subject: [PATCH] Remove migration; rely on DCA only --- src/Migration/ExtendTlSearchMigration.php | 63 -------------------- src/Resources/config/services.yaml | 10 ---- src/Resources/contao/dca/tl_search.php | 71 ++++++++++------------- 3 files changed, 32 insertions(+), 112 deletions(-) delete mode 100644 src/Migration/ExtendTlSearchMigration.php delete mode 100644 src/Resources/config/services.yaml diff --git a/src/Migration/ExtendTlSearchMigration.php b/src/Migration/ExtendTlSearchMigration.php deleted file mode 100644 index 2506ccd..0000000 --- a/src/Migration/ExtendTlSearchMigration.php +++ /dev/null @@ -1,63 +0,0 @@ -connection->fetchOne( - <<connection->executeStatement( - << [ - 'dataContainer' => 'Table', - 'sql' => [ - 'keys' => [ - 'id' => 'primary', - 'pid' => 'unique', - ], - ], - ], +declare(strict_types=1); - 'fields' => [ - 'id' => [ - 'sql' => "int(10) unsigned NOT NULL auto_increment", - ], - 'pid' => [ - 'sql' => "int(10) unsigned NOT NULL default 0", - ], - 'source' => [ - 'sql' => "varchar(32) NOT NULL default ''", - ], - 'priority' => [ - 'sql' => "int(1) NOT NULL default 2", - ], - 'keywords' => [ - 'sql' => "varchar(255) NOT NULL default ''", - ], - 'imagepath' => [ - 'sql' => "varchar(512) NOT NULL default ''", - ], - 'startDate' => [ - 'sql' => "bigint(20) NOT NULL default 0", - ], - 'checksum' => [ - 'sql' => "varchar(64) NOT NULL default ''", - ], - 'tstamp' => [ - 'sql' => "int(10) unsigned NOT NULL default 0", - ], - ], +$GLOBALS['TL_DCA']['tl_search']['fields']['keywords'] = [ + 'label' => ['Keywords', 'Suchbegriffe für die Indexierung'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => ['tl_class' => 'w50', 'maxlength' => 255], + 'sql' => "varchar(255) NOT NULL default ''", +]; + +$GLOBALS['TL_DCA']['tl_search']['fields']['priority'] = [ + 'label' => ['Priorität', 'Priorität für die Suchergebnisse'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => [1, 2, 3], + 'eval' => ['tl_class' => 'w50'], + 'sql' => "int(1) NOT NULL default '2'", +]; + +$GLOBALS['TL_DCA']['tl_search']['fields']['imagepath'] = [ + 'label' => ['Image Path', 'Speichert den Pfad des Bildes'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => ['maxlength' => 512], + 'sql' => "varchar(512) NOT NULL default ''", +]; + +$GLOBALS['TL_DCA']['tl_search']['fields']['startDate'] = [ + 'label' => ['Startdatum', 'Startdatum für die Suchergebnisse (Unix-Timestamp)'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => ['tl_class' => 'w50', 'rgxp' => 'digit'], + 'sql' => "bigint(20) NOT NULL default '0'", ]; \ No newline at end of file