strapi-generator
v1.0.3
Published
Generate Strapi modules from DB schema.
Readme
Strapi Generator
Generate Strapi modules from a MySQL database schema.
Installation
npm install -D strapi-generatorSetup
1. Create a .env file with the following variables:
SOURCE_DB_HOST=
SOURCE_DB_USER=
SOURCE_DB_PASSWORD=
SOURCE_DB_NAME=
SOURCE_DB_PORT=
SOURCE_DB_TABLE_PREFIX=- If you want to generate only the tables with the prefix, set
SOURCE_DB_TABLE_PREFIX. Otherwise, the generator will generate all tables. - Example:
SOURCE_DB_TABLE_PREFIX=tbl_will generate all tables with the prefixtbl_, such astbl_user,tbl_product, etc.
2. Run the generator:
strapi-genor run by npm script package.json
"scripts": {
"generate:modules": "strapi-gen"
}npm run generate:modules