Skip to content

Instantly share code, notes, and snippets.

@nukosuke
Last active May 28, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nukosuke/b655f67da00471289a05c96d53ee85a0 to your computer and use it in GitHub Desktop.
Save nukosuke/b655f67da00471289a05c96d53ee85a0 to your computer and use it in GitHub Desktop.
model create command for loq
$(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'
$(npm bin)/sequelize model:create \
--name Comment \
--attributes 'user_id:number, article_id:number, body_markdown:text, body_html:text'
$(npm bin)/sequelize model:create \
--name Follow \
--attributes 'origin_user_id:number, destination_user_id:number'
$(npm bin)/sequelize model:create \
--name Like \
--attributes 'user_id:number, article_id:number'
$(npm bin)/sequelize model:create \
--name Tag \
--attributes 'name:string'
$(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'
@nukosuke
Copy link
Author

nukosuke commented May 27, 2016

  • scope (belongsTo user)
  • category (hasMany tags)

@nukosuke
Copy link
Author

tag HABTMなので中間テーブルが必要

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment