Open smattingly opened 3 years ago
Keeping @Weintraubm and @Spritte77 in the loop. I will supervise this one.
@BroadusA Next step is to make the changes sails seems to want. In config/models.js
, change the property in the attributes
object from id: { type: "number", autoIncrement: true, },
to id: { type: "string", columnName: "_id", },
Next, in the config/local.js
file you created, change the createTestData
setting from false to true.
Finally, stop the application if it is running (Ctrl-C in the terminal), and launch it with npm start
. Unless there are errors, that should recreate the database with the recommended settings. I will then look at the cloud tools to see about next steps.
@smattingly @Spritte77 @Weintraubm 02/15 4:15 pm. property attributes were changed and CreateTestData setting was changed.
Ok, I can see from the database results that the code changes made no difference in the resulting database structures. So we won't need to do a redesign/update of the existing database, as I thought we might. I will work with @BroadusA to improve the code changes and test so that the code works with either MySQL or MongoDB, warning free.
It appears that there is not a straightforward way to use different configurations depending on the database driver. The critical steps happen during initialization of the app, when info about the db driver is not yet available. I think we should pause work on this until we upgrade to the latest Sails version, then revisit it.
We have now upgraded sails in production. I think the messages are still appearing when the app starts.
When we launch the app in production set up, it says:
I understand what Sails wants us to do, but I'm confused why they want it. The whole point of Sails' database portions is avoiding code that is specific to one kind of database. Since they can obviously "take care of it", why not just do that? "This time" is misleading-- it always does this. So, I went ahead and switched to MongoDB with this setup.
But, I'd like to explore this to see if we can tell any difference. (For example, does this have anything to do with the slow MongoDB performance we saw?)
Here's a rough outline: (I can help with all these steps)