Objective: To manage database scripts in a project
Requirements:
- Script version management
- Maintain script execution sequence
- Create a table
- Create by Table Category in sequence:
- Enum table, for example: all countriesCodeTable, ethnic code table. These tables do not depend on other tables
- Basic entity tables, such as the employee information table. These tables are basic entities.
- Other tables depend on other tables in the preceding table.
- Sequence of creating each table
- Use create table to create a table
- Add constraints (own)
- Add foreign key constraints
- Insert static initial data (for example, country code)
- Create views, functions, and stored procedures: Create one by dependency
- Run a script to install or reinstall the entire database.
- Execute a script to regenerate a table (including structure, data, constraints, and so on)
Database test project
- Run a script to generate or regenerate the test data.
- Execute a script to automatically test database functions, stored procedures