cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ismail_orabi
Community Participant

Schema JSON to Oracle DB DDL

Has anyone created a script to convert the Canvas Data schema.json to Oracle DB DDL statements?

3 Replies
millerjm
Community Champion

I'm not using oracle - I'm using MySQL.  However, I created the table creation SQL script myself since I wanted to normalize the database somewhat, and needed to make some changes (timestamp fields need to be datestamp, etc).  Now I only update the structure when there are changes in the release notes.  Hope that helps.  

sam_mcknight
Community Participant

When we implemented Canvas Data in Oracle, I came across a DDL script online for MySql. It required some tweaking to deal with Oracle-specific limitations (table name and column name lengths) as well as some data type changes (longtext-->clob) but that script was a lifesaver. I wish I still had that link. But check out canvancement/canvas-data/mysql at master · jamesjonesmath/canvancement · GitHub  for some php code that will generate the MySql DDL from schema.json. I haven't checked it to see if it's using the current schema.json but it should get you started in the right direction.

James
Community Champion

 @sam_mcknight  

I haven't updated the MySQL script to the latest version yet, but the PHP code is designed to generate a MySQL version by fetching the latest version of the schema. The PHP code is up a directory from the link you gave, which is to the MySQL code.