class Author(helo.Model): id = helo.Auto() name = helo.VarChar(length=45, comment='username') password = helo.VarChar(length=100) create_at = helo.Timestamp(default=helo.ON_CREATE) update_at = helo.Timestamp(default=helo.ON_UPDATE)
class Role(helo.Model): id = helo.Int(primary_key=True, auto=True) name = helo.VarChar(length=50) is_deleted = helo.Bool(default=False) create_at = helo.Timestamp(default=helo.ON_CREATE) update_at = helo.Timestamp(default=helo.ON_UPDATE) class Meta: name = 'role_'
class People(helo.Model): id = helo.Auto() name = helo.VarChar(length=45) gender = helo.Tinyint(length=1, unsigned=True) age = helo.Tinyint(unsigned=True) create_at = helo.Timestamp(default=helo.ON_CREATE) update_at = helo.Timestamp(default=helo.ON_UPDATE) class Meta: indexes = [helo.K('idx_name', 'name')]
class Post(helo.Model): id = helo.Auto(comment='auto increment pk') title = helo.VarChar(length=100) content = helo.Text(encoding=helo.ENCODING.UTF8MB4) author = helo.Int(default=0) create_at = helo.Timestamp(default=helo.ON_CREATE) update_at = helo.Timestamp(default=helo.ON_UPDATE) class Meta: indexes = [ helo.K('idx_title', 'title'), helo.K('idx_author', 'author'), ]
class User(Person): email = helo.Email(default='') password = helo.VarChar(length=100, null=False) create_at = helo.Timestamp(default=helo.ON_CREATE) class Meta: indexes = [helo.K('idx_ep', ['email', 'password'])]
class Column(helo.Model): id = helo.Auto() name = helo.Char(length=100) create_at = helo.Timestamp(default=helo.ON_CREATE)