All pastes #446436 Raw Edit

Something

public text v1 · immutable
·published 2007-04-18 14:03 UTC
rendered paste body
Book:
  tableName: books
  columns:
    title: string(200)
    edition: string(2)
    series: string(200)
    author: string(100)
    price: string(10)
    descript: string(4000)
    isbn: string(50)
    published_at: timestamp
    created_at: timestamp
    category_id: { localName: Books, foreignName: Category, foreignClass: Category }
    publisher_id: { localName: Books, foreignName: Publisher, foreignClass: Publisher }
    image_id: { localName: Book, foreignName: Image, foreignClass: Image, unique: true, cascadeDelete: true }
    
Category:
  tableName: categories
  columns:
    cmatch: string(20)
    name: string(50)
    dewey: integer
    
Publisher:
  tableName: publishers
  columns:
    publisher_id: string(5)
    name: string(20)
  
Image:
  tableName: images
  columns:
    name: string(255)
    height: integer
    width: integer
    
Tag:
  tableName: tags
  columns:
    name: string(64)
    icon: string(64)
    is_private: boolean
    is_approved: boolean
    
BookTag:
  tableName: book_tags
  columns:
    book_id: { localName: Tags, foreignName: Book, foreignClass: Book, foreignReference: id, counterpart: tag_id, cascadeDelete: true }
    tag_id: { localName: Books, foreignName: Tag, foreignClass: Tag, foreignReference: id, counterpart: book_id }