Forum Stats

  • 3,816,037 Users
  • 2,259,133 Discussions
  • 7,893,366 Comments

Discussions

How to make DB changes when deploying an APEX app from src to dest...

NikitaR
NikitaR Member Posts: 11 Blue Ribbon

Good Day All,

We are using APEX 20.2 on 19c in a Win 2012 env. We have DEV; UAT; and PROD wrkspc, and are cycling our applications accordingly.

The trouble we are running into is this:

In DEV and UAT, I have a simple app using the DEPT tbl. In Dev, I remove a col from the table. When deploying the app, I want to use an Install script to drop the col in the dest wrkspc.

I have been trying to make use of Schema compares to show diff's, and have been trying to use build scripts. However, build scripts only produce CREATE Tbl statements. In the example above, the create will fail because the tbl already exists.

I thought that by using build scripts / Schema compares, it would generate the drop statements for me.

Question: Am I supposed to be doing all of this with DML/DDL, by hand, or am I just not using the tools properly ?


Thnx,

Nikita 😎

Tagged:

Best Answer

  • Billy Verreynne
    Billy Verreynne Software Engineer Member Posts: 28,803 Red Diamond
    Answer ✓

    Changes to the data model is not a simplistic let-the-tool-do-it issue.

    That column could be used as a foreign key, a SQL predicate or join criteria, or part of a SQL projection, in other db objects such as tables and views. Dropping a column can break dependant objects. Then there is the requirement of an exclusive lock on the table for changing its structure, which can cause havoc on a busy database.

    As developer you need to be aware of what the impacts of your data model changes are on production, and address these with the DBA/ops team. Change control is critical. This is not an issue you can address alone, or with a tool.

Answers

  • Billy Verreynne
    Billy Verreynne Software Engineer Member Posts: 28,803 Red Diamond
    Answer ✓

    Changes to the data model is not a simplistic let-the-tool-do-it issue.

    That column could be used as a foreign key, a SQL predicate or join criteria, or part of a SQL projection, in other db objects such as tables and views. Dropping a column can break dependant objects. Then there is the requirement of an exclusive lock on the table for changing its structure, which can cause havoc on a busy database.

    As developer you need to be aware of what the impacts of your data model changes are on production, and address these with the DBA/ops team. Change control is critical. This is not an issue you can address alone, or with a tool.

  • NikitaR
    NikitaR Member Posts: 11 Blue Ribbon

    Billy,

    Thank you very much. That is in fact what I figured.

    Have a groovy day.


    Nikita

    😎