Column | Type | Options |
---|---|---|
nickname | string | null: false, unique: true |
string | null: false, unique: true | |
password | string | null: false |
last_name | string | null: false |
first_name | string | null: false |
last_name_kana | string | null: false |
first_name_kana | string | null: false |
birthday | string | null: false |
profile | text | |
image | string |
- has_many :comments
- has_many :likes
- has_many :items
- has_many :ordercomments
- has_many :addresses
- has_many :users_transacts
- has_many :transacts, through::users_transacts
Column | Type | Options |
---|---|---|
name | string | null: false, index: true |
price | integer | null: false, index: true |
size | integer | enum, index: true |
condition | integer | enum, null: false |
shipping_date | integer | enum, null: false |
shipping_price | integer | enum, null: false |
shipping_area | integer | enum, null: false |
shipping_method | integer | enum, null: false |
category_id | references | null: false, foreign_key: true |
brand_id | references | null: false, foreign_key: true |
user_id | references | null: false, foreign_key: true |
- has_many :images
- has_many :comments
- has_many :likes
- has_many :orders
- belongs_to :user
- belongs_to :category
- belongs_to :brand
Column | Type | Options |
---|---|---|
postal_code | integer | null: false |
prefecture | string | null: false |
city | string | null: false |
street | string | null: false |
building | string | |
phone | string | null: false |
first_name | string | null: false |
last_name | string | null: false |
first_name_kana | string | null: false |
last_name_kana | string | null: false |
user_id | references | null: false, foreign_key: true |
- belongs_to :user
Column | Type | Options |
---|---|---|
user_id | references | null: false, foreign_key: true |
transact_id | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :transact
Column | Type | Options |
---|---|---|
evaluate | integer | enum, null: false |
confirm | boolean | default: false |
body | text | |
seller_id | integer | |
buyer_id | integer | |
item_id | references | null: false, foreign_key: true |
- has_many :users_transacts
- belongs_to :user
- belongs_to :item
Column | Type | Options |
---|---|---|
comment | text | null: false |
user_id | references | null: false, foreign_key: true |
order_id | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :order
Column | Type | Options |
---|---|---|
state | integer | null: false, dafault: 0 |
item_id | references | null: false, foreign_key: true |
- has_many :ordercomments
- belongs_to :item
Column | Type | Options |
---|---|---|
name | string | null: false, index: true |
ancestry | integer | index: true |
item_id | references | null: false, foreign_key: true |
- has_many :items
- has_many :brands_categories
Column | Type | Options |
---|---|---|
name | string | null: false, index: true |
item_id | references | null: false, foreign_key: true |
- has many :items
- has many :categories, through brands_categories
Column | Type | Options |
---|---|---|
brand_id | references | null: false, foreign_key: true |
category_id | references | null: false, foreign_key: true |
- belongs_to :brand
- belongs_to :category
Column | Type | Options |
---|---|---|
image | string | null: false |
item_id | references | null: false, foreign_key: true |
- belongs_to :item
Column | Type | Options |
---|---|---|
comment | text | null: false |
user_id | references | null: false, foreign_key: true |
item_id | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :item
Column | Type | Options |
---|---|---|
user_id | references | null: false, foreign_key: true |
item_id | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :item