Skip to content

Instantly share code, notes, and snippets.

@FredrikAppelros
Created October 8, 2013 14:41
Show Gist options
  • Save FredrikAppelros/6885819 to your computer and use it in GitHub Desktop.
Save FredrikAppelros/6885819 to your computer and use it in GitHub Desktop.
sequelize attribute problem
Sequelize = require 'sequelize'
sequelize = new Sequelize 'sequelize-test', 'postgres', 'changeme123',
host: 'localhost'
port: 5432
dialect: 'postgres'
A = sequelize.define 'a', name: Sequelize.STRING
Attribute = sequelize.define 'attribute', name: Sequelize.STRING
A.hasMany Attribute
sequelize.sync().success ->
A.create(name: 'a').error (err) ->
console.log err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment