Skip to content

Instantly share code, notes, and snippets.

View mike-zipit's full-sized avatar

Mike Crowe mike-zipit

View GitHub Profile
@mike-zipit
mike-zipit / temp.js
Created May 1, 2019 12:30
Write webpack config to /tmp
return {
// ...
plugins: [
// ...
{
apply(compiler) {
compiler.hooks.beforeRun.tapAsync("WebpackConfig", function(compiler, cb) {
require("fs").writeFileSync("/tmp/webpack.config.new.js", require('util').inspect(compiler.options, {depth: 6, compact: false, sorted: true}), "utf8");
cb();
});
@mike-zipit
mike-zipit / README.md
Last active May 25, 2018 18:20
Loopback 3.x MySQL Foreign Key notes

Examples below assume a Customer that hasMany Clients, and a Client belongsTo a Customer. And, a Customer hasOne Administrator (for example purposes)

belongsTo

belongsTo must include exact foreignKey entry of column name of this table that links to the parent table

  • Client "relations" section:
    "type": "belongsTo",
    "model": "Customer",                     
 "foreignKey": customerId"