ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Brohl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-9902) Create a DATAMODELCHANGES.md to track data model changes
Date Sat, 28 Oct 2017 09:11:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-9902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16223361#comment-16223361
] 

Michael Brohl commented on OFBIZ-9902:
--------------------------------------

Thanks for the initiative, [~aditya.sharma]!

I think we should additionally provide SQL migration scripts along with the changes.
As an example: we lately introduced the fromDate as part of the PK in SecurityPermission.

So additionally to the change log you proposed, I would add a migration SQL for the Derby
database.

{code:sql}
ALTER TABLE SECURITY_PERMISSION ADD FROM_DATE DATETIME;
UPDATE SECURITY_PERMISSION SET FROM_DATE = '2017-01-01 00:00:00.0';
ALTER TABLE SECURITY_PERMISSION DROP PRIMARY_KEY, ADD PRIMARY KEY (PERMISSION_ID, FROM_DATE);
{code}

(this might be syntactically incorrect, it's only an example).

I also would like to see every change in order of it's introduction. So the order would not
be on the entity level but on the database level.
By changing primary keys and such, relations could also be affected and I think it would make
sense to have everything in order, especially for migrations.

In our db changelogs, we also list new seed data as OFBiz load data to prevent missing data
which is needed by added or changed funtionality.

In my view, the main use case of a db changelog is to help users keep their database up-to-date
without the need to monitor everything themselves and do a migration by trial-and-error so
it should be as comprehensive as possible.

As a general rule, I would like to introduce the guideline to provide a changelog along with
every database or functionality change affecting the data, latest within the commit. If you
take the time to work this out, we should take care to keep it up-to-date in the community.

Thanks,
Michael

> Create a DATAMODELCHANGES.md to track data model changes
> --------------------------------------------------------
>
>                 Key: OFBIZ-9902
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9902
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: Trunk
>            Reporter: Aditya Sharma
>            Assignee: Aditya Sharma
>
> The file will have the format:
> Entity Changes:
> Here we will have a bulleted list with entity names and the revision changes took place
> 1. Added Entities
> 2. Removed Entities
> Field changes:
> Here we will show data in tabular form in format
> entityname | field | action | isPK | revision



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message