Missed column "ENTITY_INSTANCE_NAME" in table SEC_ENTITY_LOG

Hi,
Platform version: platform-6.10-SNAPSHOT
Studio Version: 6.10.2
In one off my apps I detect one the bellow sql instruction fail.
alter table SEC_ENTITY_LOG add ENTITY_INSTANCE_NAME varchar(1000)^ I detect this because all of operations fails because this column name doesn’t exist in database I think the fails occurs because of this char"^" in the sql instruction.

Who is the best way to solve this situation?

Regards,
João Gomes

Hi João,
The “^” symbol is normal in CUBA DDL scripts as it just separates the commands.
If you need to execute the command manually, do not include ^ when using a standard SQL execution tool of your database.

Hi

Setting up entity log for the first time in production we faced the same issue. Adding the column manually sec_entity_log.entity_instance_name fixed the problem.

We do not use automatic database update in production, gathering the necessary sql scripts and using a mechanism of our own.

So each time we upgrade cuba platform version we have to take much care than usual to gather necessary sql. We probably missed something at one point thus this column was not set up.

Similarly to this topic here, it would be nice that cuba platform migration scripts are visible in Studio like any model update.

In fact, when you install a new addon or upgrade cuba platform on an existing database, this is an incremental update, and should be processed exactly the same as any update of the application data model.

Do you think it makes sense @knstvk ?

Regards
Michael

Hi Michael

In fact, the framework contains a mechanism that can help you in manual applying migration scripts on the production database: Initializing and Updating a Database from The Command Line. This command line tool has check parameter that should show all existing but unapplied scripts. So you can deploy a new version of you app, and before starting it run this tool - you will see the list of scripts to apply.

Would be great if you try it and give us your feedback (in a separate topic plz).

Very interesting, we have a release incoming and I will try it for sure, in a new topic :wink: