Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise à jour de v1.0.0 vers v1.0.1 en mode "singledatabase" #124

Open
thom4parisot opened this issue Nov 9, 2020 · 1 comment
Open

Mise à jour de v1.0.0 vers v1.0.1 en mode "singledatabase" #124

thom4parisot opened this issue Nov 9, 2020 · 1 comment

Comments

@thom4parisot
Copy link

Bonjour,

Quand je tente de mettre à jour une instance de Lodel qui fait référence à $cfg['singledatabase'] = 'on'; dans le fichier lodelconfig.php, je rencontre l'erreur suivante en lançant la commande php 1.0.1.php all :

*** Travail sur 'hybrid' ***
Select of database lodel_hybrid failed. Unknown database 'lodel_hybrid'
	Ajout des tables pour les attributs d'entrées d'index

Au runtime, le retour de C::get('singledatabase', 'cfg') est bien à 'on'.

Voici la liste des tables connues :

MariaDB [lodel]> show tables;
+-------------------------+
| Tables_in_lodel         |
+-------------------------+
| auteurs                 |
| characterstyles         |
| classes                 |
| collections             |
| entities                |
| entities_auteurs        |
| entities_collections    |
| entities_indexavances   |
| entities_indexes        |
| entitytypes_entitytypes |
| entries                 |
| entrytypes              |
| fichiers                |
| fichiersexternes        |
| history                 |
| indexavances            |
| indexes                 |
| individus               |
| internal_messaging      |
| internalstyles          |
| liens                   |
| mainplugins             |
| oailogs                 |
| oaitokens               |
| objects                 |
| optiongroups            |
| options                 |
| persons                 |
| persontypes             |
| plugins                 |
| publications            |
| relations               |
| relations_ext           |
| restricted_users        |
| search_engine           |
| session                 |
| sites                   |
| tablefieldgroups        |
| tablefields             |
| tasks                   |
| textes                  |
| textessimples           |
| texts                   |
| translations            |
| types                   |
| urlstack                |
| usergroups              |
| users                   |
| users_usergroups        |
+-------------------------+
49 rows in set (0.001 sec)

Au niveau de

$this->current_db = c::Get('database','cfg') . "_" . $site;
, si je fais cette modification, la mise à jour se déroule comme il faut semble-t'il :

- $this->current_db = c::Get('database','cfg') . "_" . $site;
+ $this->current_db = c::Get('database','cfg') . (c::Get('singledatabase','cfg') === 'on' ? '' : "_" . $site);
@nahuelange
Copy link
Contributor

Ce qui serait bien ce serait de faire une PR, afin de faciliter l'intégration de ce type de correctif.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants