old gnuviechadmin web interface code that is not developed anymore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2KB

  1. # -*- python -*-
  2. # -*- coding: utf-8 -*-
  3. import sqlalchemy as sa
  4. from gnuviechadminweb.model import meta
  5. t_group = \
  6. sa.Table("group", meta.metadata,
  7. sa.Column("id", sa.types.Integer, primary_key=True),
  8. sa.Column("name", sa.types.String(40), nullable=False,
  9. unique=True),
  10. )
  11. t_role = \
  12. sa.Table("role", meta.metadata,
  13. sa.Column("id", sa.types.Integer, primary_key=True),
  14. sa.Column("name", sa.types.String(40), nullable=False)
  15. )
  16. t_user = \
  17. sa.Table("user", meta.metadata,
  18. sa.Column("id", sa.types.Integer, primary_key=True),
  19. sa.Column("name", sa.types.String(40), nullable=False),
  20. sa.Column("password", sa.types.String(128), nullable=False),
  21. sa.Column("group_id", sa.types.Integer,
  22. sa.ForeignKey(t_group.c.id))
  23. )
  24. t_user_role = \
  25. sa.Table("user_role", meta.metadata,
  26. sa.Column("id", sa.types.Integer, primary_key=True),
  27. sa.Column("user_id", sa.types.Integer, sa.ForeignKey(t_user.c.id)),
  28. sa.Column("role_id", sa.types.Integer, sa.ForeignKey(t_role.c.id))
  29. )