the hook orm taking too long to load

前端 未结 8 1792
悲&欢浪女
悲&欢浪女 2020-12-05 14:17

i am using two database adapters with sails.

one for mondoDB and second for mysql.whenever i run command \"sails lift\".once it gives an error

error         


        
相关标签:
8条回答
  • 2020-12-05 14:59

    I realise this is quite an old question, but I also had the same problem. I was convinced it wasn't my connection.

    My solution is to change your migration option for your models and you'll have a choice of 3

    1. safe - never auto-migrate my database(s). I will do it myself (by hand)
    2. alter - auto-migrate, but attempt to keep my existing data (experimental)
    3. drop - wipe/drop ALL my data and rebuild models every time I lift Sails

    Got to config/models.js and in there put:

    migrate: 'safe'
    

    or whatever option from above you want to use.

    0 讨论(0)
  • 2020-12-05 15:02

    It is likely best to do this on a per env basis. Under config directory, you will have something like:

    Then enter, inside module.exports of each:

    module.exports = {
    
      hookTimeout: 40000
    
    }
    

    Notice, there is no need for an underscore in front of the attribute name either.

    0 讨论(0)
提交回复
热议问题