from sqlalchemy import Column, Integer, String
# 使用改装的SQLalchemy
from flask_sqlalchemy import SQLAlchemy

db=SQLAlchemy()

class Book(db.Model):
    id=Column(Integer, primary_key=True, autoincrement= True)
    title=Column(String(50),nullable=False)
    author=Column(String(30),default='未名')
    binding = Column(String(20))
    price= Column(String(20))
    pages=Column(Integer)
    pubdate=Column(String(20))
    isbn=Column(String(15), nullable=False, unique=True)
    summary=Column(String(1000))
    image=Column(String(50))