portrino / px_dbsequencer
With this extension you can ensure different unique keys for the configured tables (e.g.: pages, tt_content)
Installs: 1 458
Dependents: 0
Suggesters: 1
Security: 0
Stars: 1
Watchers: 7
Forks: 1
Open Issues: 0
Type:typo3-cms-extension
Requires
- typo3/cms-backend: ^12.4
Requires (Dev)
- ergebnis/composer-normalize: ^2.28
- friendsofphp/php-cs-fixer: ^3.14
- friendsoftypo3/phpstan-typo3: ^0.9
- helmich/typo3-typoscript-lint: ^3.1
- php-coveralls/php-coveralls: ^2.5
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- seld/jsonlint: ^1.9
- typo3/coding-standards: ^0.6
Suggests
Replaces
- typo3-ter/px-dbsequencer: 0.12.0
This package is auto-updated.
Last update: 2024-09-17 13:57:21 UTC
README
Database Sequencer for TYPO3
1 Features
The PxDbsequencer extension enables the possibility to define different unique keys for the configured tables (e.g.: pages, pages_language_overlay, tt_content).
That means, you define a global identifier, e.g. per environment, and every identifier/ primary key of the configured table(s) will be sequenced in steps of a defined offset (default: 10).
So, if configure the global identifier "1" for your production system, then every configured table will have identifiers/ primary keys like 1, 11, 21, 31 and so on. For your staging system, you may define the global identifier "2", which than results in table identifiers like 2, 12, 22, 32 and so on.
In addition, every developer of the project can have his own global identifier as well. Therefor the risk of overriding data, that has to be migrated between systems (e.g. pages and content elements for a new feature), will be minimized.
2 Usage
2.1 Installation
Installation using Composer
The recommended way to install the extension is using composer.
Run the following command within your Composer based TYPO3 project:
composer require portrino/px_dbsequencer
Installation as extension from TYPO3 Extension Repository (TER)
Download and install the extension with the extension manager module.
2.2 Setup
After finishing the installation, head over to the extension settings and set the system identifier, the offset and the tables you'd like to sequence.
The extension settings, like the system identifier, can also be configured depending on the current TYPO3_CONTEXT
via
typo3conf/AdditionalConfiguration.php
(or config/system/additional.php
)
SO, a possible configuration in typo3conf/LocalConfiguration.php
(or config/system/settings.php
) could look like:
return [
...
'EXTENSIONS' => [
...
'px_dbsequencer' => [
'offset' => 10,
'system' => 1,
'tables' => 'be_groups,be_users,pages,sys_category,sys_template,tt_content',
],
...
],
...
];
and in typo3conf/AdditionalConfiguration.php
(or config/system/additional.php
) could be something like:
// contextual environment settings
$applicationContext = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(
'/',
\TYPO3\CMS\Core\Core\Environment::getContext(),
true
);
switch ($applicationContext[0]) {
case 'Development':
switch ($applicationContext[1]) {
case 'Staging':
// TYPO3_CONTEXT: Development/Staging
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['px_dbsequencer']['system'] = 2;
break;
case 'Local':
// TYPO3_CONTEXT: Development/Local
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['px_dbsequencer']['system'] = 3;
break;
}
break;
case 'Production':
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['px_dbsequencer']['system'] = 1;
break;
}
3 Compatibility
4 Authors
- See the list of contributors who participated in this project.