DumpSync Command: Schema
The dumpsync schema command is used to generate a schema file for the database. The schema file contains the structure of the database, including tables, columns, and their data types.
dumpsync schema -f <output_file>
Command Breakdown
- dumpsync: This is the main command to invoke the DumpSync tool.
- schema: This subcommand is used to generate a schema file for the database.
Parameters
- -f
: Specifies the path to save the schema file.
Example
Generate a schema file named schema.sql
:
dumpsync schema -f schema.sql
Schema File
The schema file generated by the dumpsync schema command contains the following information:
- Tables: List of tables in the database.
- Columns: List of columns in each table along with their data types.
- Primary Keys: Primary key columns for each table.
- Foreign Keys: Foreign key columns for each table along with their references.
Schema Format
The schema file can be generated only in JSON format. The JSON format provides a structured representation of the database schema, making it easier to read and understand.