GithubHelp home page GithubHelp logo

mercari_40's Introduction

DB設計

users table

Column Type Options
nickname string index: true, null: false
family_name string null: false
first_name string null: false
family_name_kana string null: false
first_name_kana string null: false
birthday date null: false
postal_code string
prefectures string
city string
street_address string
building string
phone_number string null: false
introduction text
image string
email string null: false, unique: true

Association

  • has_many :user_evaluations
  • has_many :item_evaluations
  • has_many :items
  • has_many :favorites

user_evaluations table

Column Type Options
evaluator_id references null: false, foreign_key: { to_table: :users }
evaluatee_id references null: false, foreign_key: { to_table: :users }
evaluation integer null: false

Association

  • belongs_to :user

items table

Column Type Options
seller_id references null: false, foreign_key: { to_table: :users }
buyer_id references null: false, foreign_key: { to_table: :users }
name string index: true, null: false
description text
big_category_id references foreign_key: { to_table: :users }
middle_category_id references foreign_key: { to_table: :users }
small_category_id references foreign_key: { to_table: :users }
brand_id references foreign_key: true
size_id references foreign_key: true
condition_id references null: false, foreign_key: true
shipping_cost_id references null: false, foreign_key: true
shipping_method_id references null: false, foreign_key: true
sender_prefecture string null: false
days_for_shipment_id references null: false, foreign_key: true
status_id references null: false, foreign_key: true
price integer null: false

Association

  • belongs_to :user
  • has_many :item_images
  • has_one :condition
  • has_one :shipping_cost
  • has_one :shipping_method
  • has_one :days_for_shipment
  • has_one :status

categories table

Column Type Options
name string null: false, index: true
parent integer

Association

  • has_many :items
  • has_many :sizes

category_sizes table

Column Type Options
category_id references null: false, foreign_key: true
size_id references null: false, foreign_key: true

Association

  • belongs_to :category

brands table

Column Type Options
name string null: false, index: true
category_id references null: false, foreign_key: true

Association

  • has_many :items

item_images table

Column Type Options
item_id references null: false, foreign_key: true
image string null: false

Association

  • belongs_to :item

sizes table

Column Type Options
name string null: false
category_id references null: false, foreign_key: true
size_group integer null: false

Association

  • belongs_to :category
  • has_many :items

conditions table

Column Type Options
name string null: false

Association

  • belongs_to :item

shipping_costs table

Column Type Options
name string null: false

Association

  • belongs_to :item

shipping_methods table

Column Type Options
name string null: false

Association

  • belongs_to :item

days_for_shipments table

Column Type Options
name string null: false

Association

  • belongs_to :item

statuses table

Column Type Options
name string null: false

Association

  • belongs_to :item

favorites table

Column Type Options
item_id references null: false, foreign_key: { to_table: :items }
user_id references null: false, foreign_key: { to_table: :users }

Association

  • belongs_to :item
  • belongs_to :user

mercari_40's People

Contributors

wish911wish avatar masatakaoba avatar ouchiryota0308 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.