Last active
May 28, 2016 11:06
-
-
Save nukosuke/b655f67da00471289a05c96d53ee85a0 to your computer and use it in GitHub Desktop.
model create command for loq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name Article \ | |
--attributes 'user_id:number, published:bool, tag_id:number, year:number, month:number, day:number, slug:string, title:string, body_markdown:text, body_html:text' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name Comment \ | |
--attributes 'user_id:number, article_id:number, body_markdown:text, body_html:text' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name Follow \ | |
--attributes 'origin_user_id:number, destination_user_id:number' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name Like \ | |
--attributes 'user_id:number, article_id:number' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name Tag \ | |
--attributes 'name:string' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(npm bin)/sequelize model:create \ | |
--name User \ | |
--attributes 'uid:string:index, name:string, email:string:required, avatar:string, family_name:string, given_name:string, birthday:date, bio:string, url:string' |
Author
nukosuke
commented
May 27, 2016
•
- scope (belongsTo user)
- category (hasMany tags)
tag HABTMなので中間テーブルが必要
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment