Unfortunately, all of my RDMS experience comes from using my company's proprietary database technology, and I'm struggling to find analogues that transfer my knowledge to PHP/MySQL practices.
In my company, we define "data dictionary" configurations that define tables, fields, keys, and such:
orders_Dct.cfg
trades_Dct.cfg
profiles_Dct.cfg
One such configuration file might look like this:
table
{
name ORDERS
fields (ORDER_ID, ORDER_VS, PRICE, QUANTITY)
key
{
name ORDERS_BY_ID_VS
sort (ORDER_ID, ORDER_VS)
}
}
field
{
name ORDER_ID
type CHARARRAY
size 8
}
field
{
name ORDER_VS
type I32
}
field
{
name PRICE
type F64
}
field
{
name QUANTITY
type F64
}
Additionally, we define "static data", e.g. profiles_Static.cfg
:
table
{
name PROFILES
entry
{
USER_ID 0
USER_NAME SYSTEM
SUPER_USER Y
}
entry
{
USER_ID 1
USER_NAME TEST
SUPER_USER N
}
}
We then run commands such as Install
, Remap
, and LoadStatic
to update the database based on these configuration files.
Now, I can write scripts of course, perhaps even replicating the way my company does things, but I think there must be some standard way to do this in PHP/MySQL. I wonder if I'm searching with the wrong terminology in mind, because based on terms like "mysql", "database", "dictionary", "configuration", and "rollout" I found only this question about a utility to create a database dictionary, which, at least on first glance, doesn't seem like what I'm looking for. I would like a simple, configuration-file-based approach to setting up database tables, fields, keys, and static data. Would someone point in me in the right direction?
If there is no such "standard" practice, then there must be a good reason, and I'm open to adapting to a different way of doing things. But it definitely seems silly to have to write a custom script for this purpose!
Thanks in advance.