Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

nukosuke commented May 27, 2016

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

This comment has been minimized.

Copy link
Owner Author

nukosuke commented May 28, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.