Guest User

Untitled

a guest
Oct 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. CREATE TABLE IF NOT EXISTS `file_favorites` (
  2.     `uid` INT ( 11 ) NOT NULL,
  3.     `file_id` VARCHAR ( 6 ) NOT NULL,
  4.     `favorite` INT ( 2 ) SIGNED NOT NULL,
  5.     KEY `uid` (`uid`),
  6.     KEY `file_id` (`file_id`)
  7. ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
  8.  
  9. class FileFavorite(Base):
  10.     """ The SQLAlchemy declarative model class for a FileFavorite object. """
  11.     __tablename__ = 'file_favorites'
  12.     __table_args__ = {
  13.         'mysql_engine': 'InnoDB',
  14.         'mysql_charset': 'utf8'
  15.     }
  16.     uid = Column(INTEGER(11), nullable=False)
  17.     file_id = Column(VARCHAR(6), nullable=False)
  18.     favorite = Column(INTEGER(2), nullable=False)
Add Comment
Please, Sign In to add comment