keithwhor/nodal

How to set column default from migration file?

MrSkinny opened this issue · 2 comments

Say I want a db column to have a default value? I tried:

this.createTable("products", [
  { "name": "rating", "type": "integer", "properties": { "default": 1 } }
]);

But the schema.json file created has an empty properties object.

Hi again MrSkinny,
not really sure about this one but you should use "defaultValue" instead of "default".
Hope it'll help

Neither 'default' or 'defaultValue' didn't work for me