column |
type |
id |
integer(NOT NULL) |
name |
string(NOT NULL) |
email |
text(NOT NULL) |
password |
string(NOT NULL) |
has_one :shelf
has_many :reviews
column |
type |
id |
integer(NOT NULL) |
title |
string(NOT NULL) |
author |
text(NOT NULL) |
release_date |
text |
price |
publisher |
price |
string |
has_many :reviews
has_many :shelf :through => :book_shelfs
column |
type |
id |
integer(NOT NULL) |
name |
string(NOT NULL) |
user_id |
integer(NOT NULL) |
introducing |
integer(NOT NULL) |
belongs_to :user
has_many :reviews
has_many :books :through => :book_shelves
add_index :group_users, [:user_id]
column |
type |
id |
integer(NOT NULL) |
book_id |
integer(NOT NULL) |
shelf_id |
integer(NOT NULL) |
belongs_to :book
belongs_to :shelf
add_index :book_shelves, [:book_id, shelf_id]
column |
type |
id |
integer(NOT NULL) |
text |
text |
rate |
integer(NOT NULL) |
user_id |
integer(NOT NULL) |
book_id |
integer(NOT NULL) |
shelf_id |
integer(NOT NULL) |
status_id |
integer |
belongs_to :user
belongs_to :book
belongs_to :shelf
belongs_to :status
add_index :rebiews, [:user_id, :book_id, :shelf_id, :satus_id]
column |
type |
id |
integer(NOT NULL) |
state |
string(NOT NULL) |