2

I've followed this guide http://compoundjs.com/docs to create a very basic REST server. It worked when using memory as storage. After that, I tried to move to mysql.

When executing "compound db migrate" (or update) the response is:

Perform migrate on
 - mysql
1

But the database and tables are not created. Then, when starting the server or console, the database is created. But the tables are not. And migrate/update actions seems to not been working.

This is my schema.coffee file

Pin = define 'Pin', ->
  property 'name', String

Book = define 'Book', ->
  property 'link', String
  property 'pin_id', Number

Pin.hasMany(Book, {as: 'books', foreignKey: 'pin_id'})
Book.belongsTo(Pin, {as: 'pin',  foreignKey: 'pin_id'})

Those are my package.json dependencies

{ "ejs": "*"
  , "ejs-ext": "latest"
  , "express": "~3.x"
  , "compound": ">= 1.1.0"
  , "jugglingdb": ">= 0.1.0"
  , "coffee-script": ">= 1.1.1"
  , "stylus": "latest"
  , "seedjs": "latest"
  , "co-assets-compiler": "*"
}

Any help would be more than appreciated :)

1 Answers1

1

I've create 2 test apps:

a) without coffee:

compound init no_coffee_app --db mysql
cd no_coffee_app 
npm install
npm install jugglingdb-mysq
compound generate crud post title content published:boolean
compound db update

b) with coffee:

compound init testcoffee --coffee --db mysql
cd testcoffee 
npm install
npm install jugglingdb-mysq
compound generate crud post title content published:boolean
compound db update

It doesn't work for coffee variant for me.

And works well for project without --coffee flag.

user1852788
  • 4,278
  • 26
  • 25