Upgrade script generated not optimized

0
Hi Everyone We are planning to upgrade to mendix 8 from 7 and have a lot of float attributes that needs now to be converted to decimal. The upgrade script generated handle each column on its own even if they are in the same table.  The problem with this is we have some very large tables with a few columns on each that mendix upgrade in the scripts. Doing one update per column at a time is very slow. We need to upgrade in a short window of time.  Below is a sample of 2 columns handled separately. Is there a way mendix could generate the script more optimized like for instance see below. Generated: ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" RENAME COLUMN "FIXEDPORTION" TO "5F4B4DCE0C7C49E3AE15492A691265"; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" ADD "FIXEDPORTION" number(28, 8) NULL; UPDATE "BLAZE$AFFORDABILITYTRACKING"  SET "FIXEDPORTION" = CASE WHEN 1.0E20 > "5F4B4DCE0C7C49E3AE15492A691265" THEN "5F4B4DCE0C7C49E3AE15492A691265" ELSE 0 END; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" DROP COLUMN "5F4B4DCE0C7C49E3AE15492A691265"; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" RENAME COLUMN "DISPOSABLEMTHINCOME" TO "D1AE4A062D7F42DF89287C0102B09C"; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" ADD "DISPOSABLEMTHINCOME" number(28, 8) NULL; UPDATE "BLAZE$AFFORDABILITYTRACKING"  SET "DISPOSABLEMTHINCOME" = CASE WHEN 1.0E20 > "D1AE4A062D7F42DF89287C0102B09C" THEN "D1AE4A062D7F42DF89287C0102B09C" ELSE 0 END; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" DROP COLUMN "D1AE4A062D7F42DF89287C0102B09C"; Optimised will look like this maybe: ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" RENAME COLUMN "FIXEDPORTION" TO "5F4B4DCE0C7C49E3AE15492A691265"; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" RENAME COLUMN "DISPOSABLEMTHINCOME" TO "D1AE4A062D7F42DF89287C0102B09C";   ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" ADD "FIXEDPORTION" number(28, 8) NULL; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" ADD "DISPOSABLEMTHINCOME" number(28, 8) NULL;   UPDATE "BLAZE$AFFORDABILITYTRACKING"  SET "FIXEDPORTION" = CASE WHEN 1.0E20 > "5F4B4DCE0C7C49E3AE15492A691265" THEN "5F4B4DCE0C7C49E3AE15492A691265" ELSE 0 END,       "DISPOSABLEMTHINCOME" = CASE WHEN 1.0E20 > "D1AE4A062D7F42DF89287C0102B09C" THEN "D1AE4A062D7F42DF89287C0102B09C" ELSE 0 END;   ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" DROP COLUMN "5F4B4DCE0C7C49E3AE15492A691265"; ALTER TABLE "BLAZE$AFFORDABILITYTRACKING" DROP COLUMN "D1AE4A062D7F42DF89287C0102B09C";   We can manually update the generated script and run our selves but it could lead to errors in us manually updating it as we have a very large database with many tables. , and we are lazy :)
asked
1 answers
1

If your question is if the modeler can do this, the answer is no. The modeler or the runtime are creating these scripts that do everything step by step. You could run your optimized script on the database yourself, but this is not possible in the mendix cloud. You would need to download a db dump, run your script and upload it again. This definitely takes more time than the script generated by mendix.
If you are workin on premise and can access your db directly, that would be an option. But I would be really carefull with database operations outside of the mendix runtime. There is always the risk of breaking something.

answered