2013-05-17 44 views
2

我按照本指南http://compoundjs.com/docs創建了一個非常基本的REST服務器。 當使用內存作爲存儲時,它起作用。之後,我試圖移動到MySQL。複合數據庫更新/遷移不在mysql中工作

當執行「化合物分貝遷移」(或更新)的響應是:

Perform migrate on 
- mysql 
1 

但是數據庫和表不創建。 然後,在啓動服務器或控制檯時,將創建數據庫。 但表格不是。遷移/更新操作似乎沒有奏效。

這是我schema.coffee文件

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'}) 

這些都是我的package.json依賴

{ "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": "*" 
} 

任何幫助將超過讚賞:)

回答

1

我創建2測試應用程序:

a)無咖啡:

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)用咖啡:

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 

它不會對咖啡變種爲我工作。

並且適用於沒有 - coffee標誌的項目。

+0

它固定在v1.1.9 – Anatoliy