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

PH-430: Store database install time #18651

Merged
merged 7 commits into from
Dec 13, 2022
Merged

PH-430: Store database install time #18651

merged 7 commits into from
Dec 13, 2022

Conversation

jmleroux
Copy link
Contributor

@jmleroux jmleroux commented Dec 12, 2022

Add a pim_configuration entry to store some installation data. Currently only the time of installation.
This data will be then used to check if a PIM is installed instead of the current test which only test for oro_user table existence. Because this table can exists even if there were issues in the install process.
The date is set only at the end of the full database installation and is then more strict than the mere presence of a table.

I also add a migration to initialize this date for existing PIMs. I use the oro_user table creation date to be consistent with the current test.

@jmleroux jmleroux added this to the Serenity milestone Dec 12, 2022
@jmleroux jmleroux force-pushed the PH-430-install-time branch from 24ef289 to 3cd39c4 Compare December 13, 2022 08:31
@jmleroux jmleroux marked this pull request as ready for review December 13, 2022 09:20
@jmleroux jmleroux force-pushed the PH-430-install-time branch from ac1e95c to 77d1aa4 Compare December 13, 2022 10:22
* @copyright 2022 Akeneo SAS (http://www.akeneo.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
final class InstallDataQuery
Copy link
Contributor

@ahocquard ahocquard Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a SQL query, but not from the application point of view (command and query generally).

PersistInstallTime in a different namespace Persistence/Sql?

{
}

public function setInstallTime(): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withDatetime and I would delegate the responsibility of specifying the datetime to the caller for testability (because it's missing a test and this insert is important).

@@ -184,6 +174,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
);
}

$this->installTimeQuery->setInstallTime();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will you create a dedicated service for installation later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. Probably. :)

@jmleroux jmleroux force-pushed the PH-430-install-time branch from 49971b3 to 1e95a7d Compare December 13, 2022 15:43
@jmleroux jmleroux merged commit dd1f364 into master Dec 13, 2022
@jmleroux jmleroux deleted the PH-430-install-time branch December 13, 2022 17:10
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 30, 2023
tseho pushed a commit that referenced this pull request Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants