"database scripts are not applied" warning appears again and again

In a little test project I made, this warning pops up every time I start the application from the IDE:

image

It doesn’t matter if I click update or continue, the warning will pop up the next time as well. They tables are all correctly generated. The mentioned init scripts are not in the SYS_DB_CHANGELOG, but I guess they don’t have to be.

Any idea why this happens?

Hi,
We need more information for investigation.

  1. Which CUBA Studio plugin version do you use? (latest is 15.1)

  2. Can you attach here what is the content of the SYS_DB_CHANGELOG table:

select * from SYS_DB_CHANGELOG
order by create_ts
  1. What is the output of the “gradlew updateDb” command if you run it in the terminal?

  2. Are these files from your project, or one of addons?
    Are they empty, or filled with some scripts?

Hi @AlexBudarov, thanks for your response.

  1. 15.1-202

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 807ms
2 actionable tasks: 1 executed, 1 up-to-date
Changelog
10-cuba/update/mysql/20/201007-fixAttributeName.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/181210-addUserPasswordEncryption.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/181024-addCcAndBccToSendingMessage.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/180704-addNotNullForConfig.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/180331-truncateQueryResultTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/180321-addContentBodyTypeColumnToSendingMessage.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/180312-renameColumns.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/180112-alterDynamicAttributeDoubleType.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/171229-addRefreshTokenColumnToAccessTokenTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/171227-createIndexStartedTsDescToSessionLog.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/1712011010-renameRestApiTokenTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/18/181227-addScreenHistorySupportedIdTypes.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190321-addEntityLogInstanceName.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190326-renameScheduledTaskColumns.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/20/200608-alterScheduledTaskMethodParams.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/191226-setDefaultSecurityScope.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/191225-addRoleSecurityScope.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/191223-addSysTenantIdForCubaEntities.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/191030-addGroupNamesForDesignGroups.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190723-emailsWithAttachmentsSavingInHistory.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190627-dynamicAttributesImprovements.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190614-addRoleNameFieldForDesignTimeRoles.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190410-addDescriptionFieldForDynamicAttributes.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/19/190408-addNewDynamicAttrType.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/1712011010-renameRestApiTokenColumns.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/1712011000-createRestApiRefreshTokenTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/161124-FilterXmlInCategoryAttr.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/161102-setIsCollectionForExistingCategoryAttrs.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/161025-sysAttrValueParentConstraint.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/161024-collectionDynamicAttributes.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160916-addEntityIdToFtsQueue.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160725-anonymousLogin.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160626-createIndexOnFinishTimeScheduledExecution.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160616-addSizeCategoryAttribute.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160420-createUpdateTsIndexOnSysSendingMessage.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/160405-createUniqSysCategory.sql	2020-10-29 10:46:24	1
10-cuba/init/mysql/create-db.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/161124-joinAndWhereInCategoryAttr.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/16/270916-addEntityIdToQueryResult.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/171121-addLocaleToRestApiToken.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/171116-addGlobalDefaultToFilterEntity.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/171002-addUserLoginToRestApiToken.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170829-addLocaleNameColumnToCategory.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170712-createLocalizedConstraintMessageTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170620-alterConstraints.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170502-createSessionHistoryTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170228-createRestApiTokenTable.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170221-addEntityIdToAttributeValue.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170215-addEntityIdToEntityLog.sql	2020-10-29 10:46:24	1
10-cuba/update/mysql/17/170214-addEntityIdToSnapshot.sql	2020-10-29 10:46:24	1
50-mfvp/update/mysql/20/201029-2-createEntry.sql	2020-10-29 10:46:32	0
50-mfvp/update/mysql/20/201029-1-createEntry.sql	2020-10-29 10:46:32	0
50-mfvp/update/mysql/20/201029-2-updateEntry_DropScript.sql	2020-10-29 11:11:11	0
50-mfvp/update/mysql/20/201029-2-updateEntry01.sql	2020-10-29 11:11:11	0
50-mfvp/update/mysql/20/201029-2-updateEntry.sql	2020-10-29 11:11:11	0
50-mfvp/update/mysql/20/201029-1-createPartner.sql	2020-10-29 11:11:11	0
60-mfvp/update/mysql/21/210115-2-updatePartner.sql	2021-01-15 20:54:23	0
60-mfvp/update/mysql/21/210120-2-updatePartner.sql	2021-01-20 22:12:55	0
60-mfvp/update/mysql/21/210120-2-updatePartner01.sql	2021-01-20 22:12:55	0
  1. They are generated from my project. They are filled with content apart from 30.create-db.sql

Hi,
I’m not sure how you managed to get this database state, but you can fix the error manually.
Insert necessary entries to the SYS_DB_CHANGELOG table (anyway they should be in that table), and warnings will stop appearing.

insert into SYS_DB_CHANGELOG (SCRIPT_NAME, CREATE_TS, IS_INIT)
values ('60-xxx/init/mysql/10.create-db.sql', current_timestamp, 1);
-- and 2 others

Ok, thanks, I wasn’t sure if the init sql scripts have to be in the changelog table. I don’t know why they aren’t, but will insert them.

What is the difference between 50-* and 60-* scripts? Has the number a particular meaning?

The number is for ordering. We need to make sure that Cuba scripts are executed first. Then addons in the order of their dependency. Finally - project’s scripts. I think you can try both values , 50 and 60, whatever will work.

1 Like