-
Notifications
You must be signed in to change notification settings - Fork 521
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
Conversation
24ef289
to
3cd39c4
Compare
upgrades/schema/Version_7_0_20221212160000_add_database_install_time.php
Outdated
Show resolved
Hide resolved
src/Akeneo/Platform/Bundle/InstallerBundle/Persistence/Query/InstallTimeQuery.php
Outdated
Show resolved
Hide resolved
ac1e95c
to
77d1aa4
Compare
* @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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. Probably. :)
49971b3
to
1e95a7d
Compare
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.