Skip to content

Database setup

MySQL

Our MySQL database consists of the following tables:

  • User management related tables
  • user
  • user_notification_subscription
  • user_preference
  • Flow related tables
  • flow
  • flow_execution
  • environment
  • cron_entry
  • flow_execution_job_dispatch_log_entry
  • flow_execution_progress_information
  • Flow config related tables:
  • config_snippet
  • job_dispatcher_mapping
  • job_dispatcher_mapping_config
  • infrastructure
  • worker
  • transport_configuration
  • filesystem
  • ...

We are using doctrine migrations to manage the database schema. The migrations are located in the src/Migrations directory. To create an empty schema, run the following command:

bin/console doctrine:schema:create
bin/console doctrine:migrations:migrate

MongoDB

We have 2 MongoDB databases: One is called transfer database and it is used for all the e-commerce related data. The other one is called the logs database. It currently has 2 collections (logs and validation_info).

We are using these 4 environment variables to configure the MongoDB connection:

MONGODB_URL=mongodb://mongo:27017
MONGODB_DB=synqup

MONGODB_LOGS_URL=mongodb://mongo:27017
MONGODB_LOGS_DB=logs

The collections in the transfer database are corresponding to our data model. You can find the data model in the projects synqup/common-bundle and synqup/commerce-bundle.

To create an empty schema, run the following command:

bin/console doctrine:mongodb:schema:create
bin/console doctrine:mongodb:schema:create --db=logs

It is possible to run into a MongoDB Atlas error:

$listSearchIndexes stage is only allowed on MongoDB Atlas
In this case, adjust the command above to:
bin/console doctrine:mongodb:schema:create --skip-search-indexes
bin/console doctrine:mongodb:schema:create --db=logs --skip-search-indexes