class luxon_role(SQLModel): id = Uuid(default=uuid4, internal=True) name = String(max_length=64, null=False) description = Text() creation_time = DateTime(default=now, internal=True) primary_key = id unique_role = UniqueIndex(name) db_default_rows = ROLES roles = Index(name)
class luxon_endpoint(SQLModel): id = Uuid(default=uuid4, internal=True) name = Fqdn(max_length=64, null=False) interface = Enum('public', 'internal', 'admin', null=False) region = String(max_length=64, null=False) uri = Uri(max_length=64, null=False) creation_time = DateTime(default=now, internal=True) primary_key = id unique_endpoint = UniqueIndex(interface, uri) endpoint_name = Index(name) endpoint_find = Index(name, interface) endpoint_exact = Index(name, interface, region)
class luxon_user_role(SQLModel): id = Uuid(default=uuid4, internal=True) role_id = Uuid() domain_id = Uuid() tenant_id = String() user_id = Uuid() creation_time = DateTime(default=now) unique_user_role = UniqueIndex(role_id, tenant_id, user_id) user_role_id_ref = ForeignKey(role_id, luxon_role.id) user_role_domain_ref = ForeignKey(domain_id, luxon_domain.id) user_roles = Index(domain_id, tenant_id) primary_key = id db_default_rows = USER_ROLES
class Model_Test2(SQLModel): id = Integer(length=11, null=True) primary_key = id stringcol = String(length=128) floatcol = Float(4,4) doublecol = Double(4,4) decimalcol = Decimal(4,4) datetimecol = DateTime(4,4) pyobject = PyObject() blob = Blob() text = Text() enum = Enum('option1', 'option2') boolean = Boolean() unique_index2 = UniqueIndex(stringcol)
class luxon_tenant(SQLModel): id = Uuid(default=uuid4, internal=True) domain_id = Uuid(internal=True) tenant_id = Uuid(internal=True) name = String(max_length=100, null=False) enabled = Boolean(default=True) creation_time = DateTime(default=now, internal=True) unique_tenant = UniqueIndex(domain_id, name) tenants = Index(id, domain_id) tenants_search_name = Index(domain_id, name) tenants_per_domain = Index(domain_id) primary_key = id tenant_domain_ref = ForeignKey(domain_id, luxon_domain.id) tenant_parent_ref = ForeignKey(tenant_id, id)
class luxon_user(SQLModel): id = Uuid(default=uuid4, internal=True) tag = String(max_length=30, null=False) domain_id = Uuid(null=False, internal=True) tenant_id = Uuid(internal=True) username = Username(max_length=100, null=False, readonly=True) password = String(max_length=100, null=False) email = Email(max_length=255) name = String(max_length=100) phone_mobile = Phone() phone_office = Phone() designation = Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof') last_login = DateTime(internal=True) enabled = Boolean(default=True) creation_time = DateTime(default=now, internal=True) unique_username = UniqueIndex(domain_id, username) user_tenant_ref = ForeignKey(tenant_id, luxon_tenant.id) user_domain_ref = ForeignKey(domain_id, luxon_domain.id) users = Index(domain_id, username) users_tenants = Index(domain_id, tenant_id) users_domain = Index(domain_id) primary_key = id db_default_rows = USERS