DDL Data Source Questions Follow
I'm looking into database versioning using the DDL Data Source function.
1. Is it possible to organize the generated SQL scripts into folders based on schema & object type like the Database Explorer does? Right now, everything is under schema.
2. If I wish to add script to initialize a table with data, it should not be placed in the generated script files because it will be overwritten. Correct?
3. The general workflow is to create, modify, delete database objects using the GUI tools & let the DDL Data Source files auto sync if turned on. Correct? The workflow is NOT to modify DDL Data Source script files & push to the database. Right? Or can it work both ways?
Please sign in to leave a comment.
1. Yes, that part is scriptable.
In Data Source settings there is an option to choose layout script:
You can add your layout scripts here:
2. Yes, now there is no way to store this scripts inside "generated" root. That seems to be a reasonable feature. Now this is just a conceptual problem how to identify the files that should not be recreated
3. There is no "auto sync" in your meaning. DDL Data Source is about mapping files to lets say the tree in database view, so auto sync setting is about updates of that tree from files. Synchronisation between real data source and ddl one (configured by ddl mapping) is manual both ways - you decide when to dump real db to disk, or when to restore from disk to db.
We have ui tools to edit both types of object, or you can manually edit code (but this will be regenerated in other "style" if you'll dump the same changes from db some day)
Have you figure it out how to organize the generated SQL scripts into folders based on schema & object type? Can you share your groovy script?
Alexander Kass, is there any documentation for packages?
How to get the type?
I figured it out.
If anyone needs that, here it is:
It will create a folder structure like: