Auto-create mysql table with StrongLoop

后端 未结 8 821
栀梦
栀梦 2021-02-07 11:39

I am trying to use Strongloop with MySql but cannot figure out how to migrate or automatically create tables into a MySql database.

Is there at least a way to export the

8条回答
  •  不思量自难忘°
    2021-02-07 12:35

    In the same kind of issue, if you need to automatically create a database, you can use the createDatabase option in your dataSource JSON file.

      "mysql": {
        "host": "localhost",
        "port": 0,
        "database": "db",
        "username": "root",
        "password": "",
        "name": "mysql",
        "connector": "mysql",
        "debug": false,
        "createDatabase": true
      }
    

    So you don't need to write yourself the queries to create the base. Hope it helps.

提交回复
热议问题