The dbUtility allows you to seamlessly add and alter custom schema within Mura's database. Here's a basic example creating a table with an auto-incrementing primary key.
Here's example of creating a table and explicitly setting the primary key as well as an index.
Here's an example of adding a foreignKey.
- Valid datatypes are INT, TINYINT, CHAR, VARCHAR, TEXT, LONGTEXT, DATETIME, FLOAT, DOUBLE
- You use the LENGTH argument with CHAR and VARCHAR datatypes.
- If you add a column to a table that does not exists, it will create the table.
- If you add a column that already exists, it will be updated.