-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
25 lines (19 loc) · 970 Bytes
/
Copy pathsetup.py
File metadata and controls
25 lines (19 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from app import create_app
from cipher.database.cipher_message_database import CipherMessageDatabase
from cipher.database.user_workspace_database import UserWorkspaceDatabase
from cipher.processor.user_workspace_processor import UserWorkspaceProcessor
from core.users.processor.user_processor import UserProcessor
from settings.processor.app_settings_processor import AppSettingsProcessor
from cipher.blog.processor.blog_article_processor import BlogArticleProcessor
def ensure_database_tables_exist():
app = create_app()
with app.app_context():
UserProcessor().migrate_users_table()
UserWorkspaceProcessor().migrate_user_workspaces_table()
AppSettingsProcessor().create_table()
CipherMessageDatabase().create_table()
UserWorkspaceDatabase().create_table()
BlogArticleProcessor().create_table()
print("Database tables checked successfully.")
if __name__ == "__main__":
ensure_database_tables_exist()