Skip to main content
Open

Proposal for Optimizing Table Change Deployment

Related products:Software Factory
  • January 31, 2025
  • 5 replies
  • 75 views
Martijn Grefhorst
Robbert van Tongeren
Mark Jongeling
bverhoef
+5
  • Martijn Grefhorst
    Martijn Grefhorst
  • Robbert van Tongeren
    Robbert van Tongeren
  • Mark Jongeling
    Mark Jongeling
  • bverhoef
    bverhoef
  • Thomas Ofman
  • PeterKeeris
  • BrechtvGils
  • Teun
  • Ling Wu
  • Ghanix

Blommetje

Hi,

A suggestion for the improvement to the current deployment process for table changes in our Software Factory. At present, when a table undergoes a change, the deployment package generates a CREATE script for the entire table. This approach often results in significant data migration, which can be time-consuming during deployment.

To improve efficiency, I propose that if a table change involves adding a column at the end, the deployment package should generate an ALTER statement instead. This modification would significantly expedite the deployment process.

Implementing this change would be highly beneficial for us, as the order of columns in a table is generally not critical. The GUI is configured in the Subject, and for views, handlers, triggers, etc., the code should specify the correct columns explicitly.

Could this be considered as an optional feature in the deployment package?

Thank you for considering this suggestion.

Blommetje

Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+3

» as the order of columns in a table is generally not critical.
Given the fact that when do an alter on the table, in stead of recreate of the tabel, it could be possible that a SQL statement is written where we indeed depend upon the actual column order from SF.

This is not something that we should depend on, as this can result in strange and erroneous behavior on runtime.
So as nive to have, if there is a sql in a function (/ template ect) that depend upon the actual ordering of the column from SF. Say for example a SELECT INTO without a column definition in the select. That then a warning / validation message is raised during the build/ validation stages.

 


Robert Jan de Nie
Thinkwise blogger
Forum|alt.badge.img+5
Edwin van de Peppel wrote:

» as the order of columns in a table is generally not critical.
Given the fact that when do an alter on the table, in stead of recreate of the tabel, it could be possible that a SQL statement is written where we indeed depend upon the actual column order from SF.

This is not something that we should depend on, as this can result in strange and erroneous behavior on runtime.
So as nive to have, if there is a sql in a function (/ template ect) that depend upon the actual ordering of the column from SF. Say for example a SELECT INTO without a column definition in the select. That then a warning / validation message is raised during the build/ validation stages.

 

In general it is always advised to use a column list for inserts. Furthermore I think you should always do an impact analysis of any data model change you maken. Insert into’s without a column list will fail when the table definition is changed, regardless of where the new column has been added.

https://docs.thinkwisesoftware.com/docs/sf/guidelines_sql_formatting#dos

I do however agree that it would be great if somehow the SF would analyze any model changes and check for possible impact on the code / breaking changes. It could do this via code(template) analysis or perhaps by parsing the current codebase on the to-be-created database. Obviously the latter approach should be something you can schedule since this would be pretty resource intensive.


Jeroen van den Belt
Administrator
Forum|alt.badge.img+9

We will set the idea to Open to see how high the demand is, but we want to focus on generating an ALTER statement when the only change to the table is that a column has been added at the end.


Jeroen van den Belt
Administrator
Forum|alt.badge.img+9
NewOpen

Robert Jan de Nie
Thinkwise blogger
Forum|alt.badge.img+5
Jeroen van den Belt wrote:

We will set the idea to Open to see how high the demand is, but we want to focus on generating an ALTER statement when the only change to the table is that a column has been added at the end.

This will not work for most applications since generated trace columns exist and are used a lot. Of course you can change how they work but I doubt any existing project will. So you’ll build a feature that won’t be used. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings