Feat/move tenant id into db (#2341)

This commit is contained in:
crazywoola 2024-02-02 15:00:13 +08:00 • committed by GitHub
commit a8f23ed712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 72 additions and 63 deletions

View file

@ -1,6 +1,5 @@
import enum
import json
from math import e
from typing import List
from extensions.ext_database import db
@ -155,6 +154,7 @@ class TenantAccountJoin(db.Model):
id = db.Column(UUID, server_default=db.text('uuid_generate_v4()'))
tenant_id = db.Column(UUID, nullable=False)
account_id = db.Column(UUID, nullable=False)
current = db.Column(db.Boolean, nullable=False, server_default=db.text('false'))
role = db.Column(db.String(16), nullable=False, server_default='normal')
invited_by = db.Column(UUID, nullable=True)
created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))