Documentation
¶
Overview ¶
mysql table schema and initialize data management tools.
example data directory:
.
└── table1 # this is the table name
├── data # data scripts
│ └── v1.sql
└── schema # schema scripts
├── latest.sql # create table if not exists
└── v1.sql
how it works:
- create table __tb_schema__ for saving current schema versions
- create table __tb_schema_logs__ for logging schema upgrade
- load each table version in __tb_schema__
- range each table by given directory
- build schema - if current table is not exists, create table by latest.sql - otherwise range v*.sql higher than current version - sort by version and upgrade - insert or update __tb_schema__.schema_version - insert __tb_schema_logs__
- build data - range v*.sql higher than current version - sort by version and upgrade - insert or update __tb_schema__.data_version - insert __tb_schema_logs__
- __tb_schema__ and __tb_schema_logs__ table is the protected table, so you can not use this table
- v0.sql is the protected file, so you can not define this version
- each sql operation will be the table name in sql file
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.