dmart 0.1.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- alembic/__init__.py +0 -0
- alembic/env.py +91 -0
- alembic/scripts/__init__.py +0 -0
- alembic/scripts/calculate_checksums.py +77 -0
- alembic/scripts/migration_f7a4949eed19.py +28 -0
- alembic/versions/0f3d2b1a7c21_add_authz_materialized_views.py +87 -0
- alembic/versions/10d2041b94d4_last_checksum_history.py +62 -0
- alembic/versions/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.py +33 -0
- alembic/versions/26bfe19b49d4_rm_failedloginattempts.py +42 -0
- alembic/versions/3c8bca2219cc_add_otp_table.py +38 -0
- alembic/versions/6675fd9dfe42_remove_unique_from_sessions_table.py +36 -0
- alembic/versions/71bc1df82e6a_adding_user_last_login_at.py +43 -0
- alembic/versions/74288ccbd3b5_initial.py +264 -0
- alembic/versions/7520a89a8467_rm_activesession_table.py +39 -0
- alembic/versions/848b623755a4_make_created_nd_updated_at_required.py +138 -0
- alembic/versions/8640dcbebf85_add_notes_to_users.py +32 -0
- alembic/versions/91c94250232a_adding_fk_on_owner_shortname.py +104 -0
- alembic/versions/98ecd6f56f9a_ext_meta_with_owner_group_shortname.py +66 -0
- alembic/versions/9aae9138c4ef_indexing_created_at_updated_at.py +80 -0
- alembic/versions/__init__.py +0 -0
- alembic/versions/b53f916b3f6d_json_to_jsonb.py +492 -0
- alembic/versions/eb5f1ec65156_adding_user_locked_to_device.py +36 -0
- alembic/versions/f7a4949eed19_adding_query_policies_to_meta.py +60 -0
- api/__init__.py +0 -0
- api/info/__init__.py +0 -0
- api/info/router.py +109 -0
- api/managed/__init__.py +0 -0
- api/managed/router.py +1541 -0
- api/managed/utils.py +1850 -0
- api/public/__init__.py +0 -0
- api/public/router.py +758 -0
- api/qr/__init__.py +0 -0
- api/qr/router.py +108 -0
- api/user/__init__.py +0 -0
- api/user/model/__init__.py +0 -0
- api/user/model/errors.py +14 -0
- api/user/model/requests.py +165 -0
- api/user/model/responses.py +11 -0
- api/user/router.py +1401 -0
- api/user/service.py +270 -0
- bundler.py +44 -0
- config/__init__.py +0 -0
- config/channels.json +11 -0
- config/notification.json +17 -0
- data_adapters/__init__.py +0 -0
- data_adapters/adapter.py +16 -0
- data_adapters/base_data_adapter.py +467 -0
- data_adapters/file/__init__.py +0 -0
- data_adapters/file/adapter.py +2043 -0
- data_adapters/file/adapter_helpers.py +1013 -0
- data_adapters/file/archive.py +150 -0
- data_adapters/file/create_index.py +331 -0
- data_adapters/file/create_users_folders.py +52 -0
- data_adapters/file/custom_validations.py +68 -0
- data_adapters/file/drop_index.py +40 -0
- data_adapters/file/health_check.py +560 -0
- data_adapters/file/redis_services.py +1110 -0
- data_adapters/helpers.py +27 -0
- data_adapters/sql/__init__.py +0 -0
- data_adapters/sql/adapter.py +3210 -0
- data_adapters/sql/adapter_helpers.py +491 -0
- data_adapters/sql/create_tables.py +451 -0
- data_adapters/sql/create_users_folders.py +53 -0
- data_adapters/sql/db_to_json_migration.py +482 -0
- data_adapters/sql/health_check_sql.py +232 -0
- data_adapters/sql/json_to_db_migration.py +454 -0
- data_adapters/sql/update_query_policies.py +101 -0
- data_generator.py +81 -0
- dmart-0.1.9.dist-info/METADATA +64 -0
- dmart-0.1.9.dist-info/RECORD +149 -0
- dmart-0.1.9.dist-info/WHEEL +5 -0
- dmart-0.1.9.dist-info/entry_points.txt +2 -0
- dmart-0.1.9.dist-info/top_level.txt +23 -0
- dmart.py +513 -0
- get_settings.py +7 -0
- languages/__init__.py +0 -0
- languages/arabic.json +15 -0
- languages/english.json +16 -0
- languages/kurdish.json +14 -0
- languages/loader.py +13 -0
- main.py +506 -0
- migrate.py +24 -0
- models/__init__.py +0 -0
- models/api.py +203 -0
- models/core.py +597 -0
- models/enums.py +255 -0
- password_gen.py +8 -0
- plugins/__init__.py +0 -0
- plugins/action_log/__init__.py +0 -0
- plugins/action_log/plugin.py +121 -0
- plugins/admin_notification_sender/__init__.py +0 -0
- plugins/admin_notification_sender/plugin.py +124 -0
- plugins/ldap_manager/__init__.py +0 -0
- plugins/ldap_manager/plugin.py +100 -0
- plugins/local_notification/__init__.py +0 -0
- plugins/local_notification/plugin.py +123 -0
- plugins/realtime_updates_notifier/__init__.py +0 -0
- plugins/realtime_updates_notifier/plugin.py +58 -0
- plugins/redis_db_update/__init__.py +0 -0
- plugins/redis_db_update/plugin.py +188 -0
- plugins/resource_folders_creation/__init__.py +0 -0
- plugins/resource_folders_creation/plugin.py +81 -0
- plugins/system_notification_sender/__init__.py +0 -0
- plugins/system_notification_sender/plugin.py +188 -0
- plugins/update_access_controls/__init__.py +0 -0
- plugins/update_access_controls/plugin.py +9 -0
- pytests/__init__.py +0 -0
- pytests/api_user_models_erros_test.py +16 -0
- pytests/api_user_models_requests_test.py +98 -0
- pytests/archive_test.py +72 -0
- pytests/base_test.py +300 -0
- pytests/get_settings_test.py +14 -0
- pytests/json_to_db_migration_test.py +237 -0
- pytests/service_test.py +26 -0
- pytests/test_info.py +55 -0
- pytests/test_status.py +15 -0
- run_notification_campaign.py +98 -0
- scheduled_notification_handler.py +121 -0
- schema_migration.py +208 -0
- schema_modulate.py +192 -0
- set_admin_passwd.py +55 -0
- sync.py +202 -0
- utils/__init__.py +0 -0
- utils/access_control.py +306 -0
- utils/async_request.py +8 -0
- utils/exporter.py +309 -0
- utils/firebase_notifier.py +57 -0
- utils/generate_email.py +38 -0
- utils/helpers.py +352 -0
- utils/hypercorn_config.py +12 -0
- utils/internal_error_code.py +60 -0
- utils/jwt.py +124 -0
- utils/logger.py +167 -0
- utils/middleware.py +99 -0
- utils/notification.py +75 -0
- utils/password_hashing.py +16 -0
- utils/plugin_manager.py +215 -0
- utils/query_policies_helper.py +112 -0
- utils/regex.py +44 -0
- utils/repository.py +529 -0
- utils/router_helper.py +19 -0
- utils/settings.py +165 -0
- utils/sms_notifier.py +21 -0
- utils/social_sso.py +67 -0
- utils/templates/activation.html.j2 +26 -0
- utils/templates/reminder.html.j2 +17 -0
- utils/ticket_sys_utils.py +203 -0
- utils/web_notifier.py +29 -0
- websocket.py +231 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"""initial
|
|
2
|
+
|
|
3
|
+
Revision ID: 74288ccbd3b5
|
|
4
|
+
Revises:
|
|
5
|
+
Create Date: 2024-11-25 13:53:25.928935
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '74288ccbd3b5'
|
|
18
|
+
down_revision: Union[str, None] = None
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
op.create_table('activesessions',
|
|
26
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
27
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
28
|
+
sa.Column('token', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
29
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
30
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
31
|
+
sa.UniqueConstraint('shortname')
|
|
32
|
+
)
|
|
33
|
+
op.create_table('attachments',
|
|
34
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
35
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
36
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
37
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
38
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
39
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
40
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
41
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
42
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
43
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
44
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
45
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
46
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
47
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
48
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
49
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
50
|
+
sa.Column('media', sa.LargeBinary(), nullable=True),
|
|
51
|
+
sa.Column('body', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
52
|
+
sa.Column('state', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
53
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
54
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
55
|
+
)
|
|
56
|
+
op.create_table('entries',
|
|
57
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
58
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
59
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
60
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
61
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
62
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
63
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
64
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
65
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
66
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
67
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
68
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
69
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
70
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
71
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
72
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
73
|
+
sa.Column('state', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
74
|
+
sa.Column('is_open', sa.Boolean(), nullable=True),
|
|
75
|
+
sa.Column('reporter', sa.JSON(), nullable=True),
|
|
76
|
+
sa.Column('workflow_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
77
|
+
sa.Column('collaborators', sa.JSON(), nullable=True),
|
|
78
|
+
sa.Column('resolution_reason', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
79
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
80
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
81
|
+
)
|
|
82
|
+
op.create_table('failedloginattempts',
|
|
83
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
84
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
85
|
+
sa.Column('attempt_count', sa.Integer(), nullable=False),
|
|
86
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
87
|
+
sa.PrimaryKeyConstraint('uuid')
|
|
88
|
+
)
|
|
89
|
+
op.create_table('histories',
|
|
90
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
91
|
+
sa.Column('request_headers', sa.JSON(), nullable=False),
|
|
92
|
+
sa.Column('diff', sa.JSON(), nullable=False),
|
|
93
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
94
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
95
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
96
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
97
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
98
|
+
sa.PrimaryKeyConstraint('uuid')
|
|
99
|
+
)
|
|
100
|
+
op.create_table('invitations',
|
|
101
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
102
|
+
sa.Column('invitation_token', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
103
|
+
sa.Column('invitation_value', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
104
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
105
|
+
sa.PrimaryKeyConstraint('uuid')
|
|
106
|
+
)
|
|
107
|
+
op.create_table('locks',
|
|
108
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
109
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
110
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
111
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
112
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
113
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
114
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
115
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
116
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
117
|
+
)
|
|
118
|
+
op.create_table('permissions',
|
|
119
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
120
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
121
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
122
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
123
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
124
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
125
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
126
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
127
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
128
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
129
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
130
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
131
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
132
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
133
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
134
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
135
|
+
sa.Column('subpaths', sa.JSON(), nullable=False),
|
|
136
|
+
sa.Column('resource_types', sa.JSON(), nullable=False),
|
|
137
|
+
sa.Column('actions', sa.JSON(), nullable=False),
|
|
138
|
+
sa.Column('conditions', sa.JSON(), nullable=False),
|
|
139
|
+
sa.Column('restricted_fields', sa.JSON(), nullable=True),
|
|
140
|
+
sa.Column('allowed_fields_values', sa.JSON(), nullable=True),
|
|
141
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
142
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
143
|
+
)
|
|
144
|
+
op.create_table('roles',
|
|
145
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
146
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
147
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
148
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
149
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
150
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
151
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
152
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
153
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
154
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
155
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
156
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
157
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
158
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
159
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
160
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
161
|
+
sa.Column('permissions', sa.JSON(), nullable=False),
|
|
162
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
163
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
164
|
+
)
|
|
165
|
+
op.create_table('sessions',
|
|
166
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
167
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
168
|
+
sa.Column('token', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
169
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
170
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
171
|
+
sa.UniqueConstraint('shortname')
|
|
172
|
+
)
|
|
173
|
+
op.create_table('spaces',
|
|
174
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
175
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
176
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
177
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
178
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
179
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
180
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
181
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
182
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
183
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
184
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
185
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
186
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
187
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
188
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
189
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
190
|
+
sa.Column('root_registration_signature', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
191
|
+
sa.Column('primary_website', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
192
|
+
sa.Column('indexing_enabled', sa.Boolean(), nullable=False),
|
|
193
|
+
sa.Column('capture_misses', sa.Boolean(), nullable=False),
|
|
194
|
+
sa.Column('check_health', sa.Boolean(), nullable=False),
|
|
195
|
+
sa.Column('languages', sa.JSON(), nullable=False),
|
|
196
|
+
sa.Column('icon', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
197
|
+
sa.Column('mirrors', sa.JSON(), nullable=True),
|
|
198
|
+
sa.Column('hide_folders', sa.JSON(), nullable=True),
|
|
199
|
+
sa.Column('hide_space', sa.Boolean(), nullable=True),
|
|
200
|
+
sa.Column('active_plugins', sa.JSON(), nullable=True),
|
|
201
|
+
sa.Column('ordinal', sa.Integer(), nullable=True),
|
|
202
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
203
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
204
|
+
)
|
|
205
|
+
op.create_table('urlshorts',
|
|
206
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
207
|
+
sa.Column('token_uuid', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
208
|
+
sa.Column('url', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
209
|
+
sa.Column('timestamp', sa.DateTime(), nullable=False),
|
|
210
|
+
sa.PrimaryKeyConstraint('uuid')
|
|
211
|
+
)
|
|
212
|
+
op.create_table('users',
|
|
213
|
+
sa.Column('shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
214
|
+
sa.Column('space_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
215
|
+
sa.Column('subpath', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
216
|
+
sa.Column('uuid', sa.Uuid(), nullable=False),
|
|
217
|
+
sa.Column('is_active', sa.Boolean(), nullable=False),
|
|
218
|
+
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
219
|
+
sa.Column('displayname', sa.JSON(), nullable=True),
|
|
220
|
+
sa.Column('description', sa.JSON(), nullable=True),
|
|
221
|
+
sa.Column('tags', sa.JSON(), nullable=False),
|
|
222
|
+
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
223
|
+
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
224
|
+
sa.Column('owner_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
225
|
+
sa.Column('payload', sa.JSON(), nullable=True),
|
|
226
|
+
sa.Column('resource_type', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
227
|
+
sa.Column('password', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
228
|
+
sa.Column('roles', sa.JSON(), nullable=False),
|
|
229
|
+
sa.Column('groups', sa.JSON(), nullable=False),
|
|
230
|
+
sa.Column('acl', sa.JSON(), nullable=True),
|
|
231
|
+
sa.Column('relationships', sa.JSON(), nullable=True),
|
|
232
|
+
sa.Column('type', sa.Enum('web', 'mobile', 'bot', name='usertype'), nullable=False),
|
|
233
|
+
sa.Column('language', sa.Enum('ar', 'en', 'ku', 'fr', 'tr', name='language'), nullable=False),
|
|
234
|
+
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
235
|
+
sa.Column('msisdn', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
236
|
+
sa.Column('is_email_verified', sa.Boolean(), nullable=False),
|
|
237
|
+
sa.Column('is_msisdn_verified', sa.Boolean(), nullable=False),
|
|
238
|
+
sa.Column('force_password_change', sa.Boolean(), nullable=False),
|
|
239
|
+
sa.Column('firebase_token', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
240
|
+
sa.Column('google_id', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
241
|
+
sa.Column('facebook_id', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
242
|
+
sa.Column('social_avatar_url', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
243
|
+
sa.PrimaryKeyConstraint('uuid'),
|
|
244
|
+
sa.UniqueConstraint('shortname', 'space_name', 'subpath')
|
|
245
|
+
)
|
|
246
|
+
# ### end Alembic commands ###
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def downgrade() -> None:
|
|
250
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
251
|
+
op.drop_table('users')
|
|
252
|
+
op.drop_table('urlshorts')
|
|
253
|
+
op.drop_table('spaces')
|
|
254
|
+
op.drop_table('sessions')
|
|
255
|
+
op.drop_table('roles')
|
|
256
|
+
op.drop_table('permissions')
|
|
257
|
+
op.drop_table('locks')
|
|
258
|
+
op.drop_table('invitations')
|
|
259
|
+
op.drop_table('histories')
|
|
260
|
+
op.drop_table('failedloginattempts')
|
|
261
|
+
op.drop_table('entries')
|
|
262
|
+
op.drop_table('attachments')
|
|
263
|
+
op.drop_table('activesessions')
|
|
264
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""rm ActiveSession table
|
|
2
|
+
|
|
3
|
+
Revision ID: 7520a89a8467
|
|
4
|
+
Revises: b53f916b3f6d
|
|
5
|
+
Create Date: 2024-12-26 09:28:12.717308
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
from sqlalchemy.dialects import postgresql
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '7520a89a8467'
|
|
18
|
+
down_revision: Union[str, None] = 'b53f916b3f6d'
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
op.drop_table('activesessions')
|
|
26
|
+
# ### end Alembic commands ###
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def downgrade() -> None:
|
|
30
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
31
|
+
op.create_table('activesessions',
|
|
32
|
+
sa.Column('shortname', sa.VARCHAR(), autoincrement=False, nullable=False),
|
|
33
|
+
sa.Column('uuid', sa.UUID(), autoincrement=False, nullable=False),
|
|
34
|
+
sa.Column('token', sa.VARCHAR(), autoincrement=False, nullable=False),
|
|
35
|
+
sa.Column('timestamp', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
|
36
|
+
sa.PrimaryKeyConstraint('uuid', name='activesessions_pkey'),
|
|
37
|
+
sa.UniqueConstraint('shortname', name='activesessions_shortname_key')
|
|
38
|
+
)
|
|
39
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""make created_nd_updated_at required
|
|
2
|
+
|
|
3
|
+
Revision ID: 848b623755a4
|
|
4
|
+
Revises: 6675fd9dfe42
|
|
5
|
+
Create Date: 2024-12-29 18:03:22.671174
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
from sqlalchemy.dialects import postgresql
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '848b623755a4'
|
|
18
|
+
down_revision: Union[str, None] = '6675fd9dfe42'
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
26
|
+
batch_op.alter_column('created_at',
|
|
27
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
28
|
+
server_default=sa.func.current_timestamp(),
|
|
29
|
+
nullable=False)
|
|
30
|
+
batch_op.alter_column('updated_at',
|
|
31
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
32
|
+
server_default=sa.func.current_timestamp(),
|
|
33
|
+
nullable=False)
|
|
34
|
+
|
|
35
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
36
|
+
batch_op.alter_column('created_at',
|
|
37
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
38
|
+
server_default=sa.func.current_timestamp(),
|
|
39
|
+
nullable=False)
|
|
40
|
+
batch_op.alter_column('updated_at',
|
|
41
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
42
|
+
server_default=sa.func.current_timestamp(),
|
|
43
|
+
nullable=False)
|
|
44
|
+
|
|
45
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
46
|
+
batch_op.alter_column('created_at',
|
|
47
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
48
|
+
server_default=sa.func.current_timestamp(),
|
|
49
|
+
nullable=False)
|
|
50
|
+
batch_op.alter_column('updated_at',
|
|
51
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
52
|
+
server_default=sa.func.current_timestamp(),
|
|
53
|
+
nullable=False)
|
|
54
|
+
|
|
55
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
56
|
+
batch_op.alter_column('created_at',
|
|
57
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
58
|
+
server_default=sa.func.current_timestamp(),
|
|
59
|
+
nullable=False)
|
|
60
|
+
batch_op.alter_column('updated_at',
|
|
61
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
62
|
+
server_default=sa.func.current_timestamp(),
|
|
63
|
+
nullable=False)
|
|
64
|
+
|
|
65
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
66
|
+
batch_op.alter_column('created_at',
|
|
67
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
68
|
+
server_default=sa.func.current_timestamp(),
|
|
69
|
+
nullable=False)
|
|
70
|
+
batch_op.alter_column('updated_at',
|
|
71
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
72
|
+
server_default=sa.func.current_timestamp(),
|
|
73
|
+
nullable=False)
|
|
74
|
+
|
|
75
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
76
|
+
batch_op.alter_column('created_at',
|
|
77
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
78
|
+
server_default=sa.func.current_timestamp(),
|
|
79
|
+
nullable=False)
|
|
80
|
+
batch_op.alter_column('updated_at',
|
|
81
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
82
|
+
server_default=sa.func.current_timestamp(),
|
|
83
|
+
nullable=False)
|
|
84
|
+
|
|
85
|
+
# ### end Alembic commands ###
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def downgrade() -> None:
|
|
89
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
90
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
91
|
+
batch_op.alter_column('updated_at',
|
|
92
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
93
|
+
nullable=True)
|
|
94
|
+
batch_op.alter_column('created_at',
|
|
95
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
96
|
+
nullable=True)
|
|
97
|
+
|
|
98
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
99
|
+
batch_op.alter_column('updated_at',
|
|
100
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
101
|
+
nullable=True)
|
|
102
|
+
batch_op.alter_column('created_at',
|
|
103
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
104
|
+
nullable=True)
|
|
105
|
+
|
|
106
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
107
|
+
batch_op.alter_column('updated_at',
|
|
108
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
109
|
+
nullable=True)
|
|
110
|
+
batch_op.alter_column('created_at',
|
|
111
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
112
|
+
nullable=True)
|
|
113
|
+
|
|
114
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
115
|
+
batch_op.alter_column('updated_at',
|
|
116
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
117
|
+
nullable=True)
|
|
118
|
+
batch_op.alter_column('created_at',
|
|
119
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
120
|
+
nullable=True)
|
|
121
|
+
|
|
122
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
123
|
+
batch_op.alter_column('updated_at',
|
|
124
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
125
|
+
nullable=True)
|
|
126
|
+
batch_op.alter_column('created_at',
|
|
127
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
128
|
+
nullable=True)
|
|
129
|
+
|
|
130
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
131
|
+
batch_op.alter_column('updated_at',
|
|
132
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
133
|
+
nullable=True)
|
|
134
|
+
batch_op.alter_column('created_at',
|
|
135
|
+
existing_type=postgresql.TIMESTAMP(),
|
|
136
|
+
nullable=True)
|
|
137
|
+
|
|
138
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""add notes to users
|
|
2
|
+
|
|
3
|
+
Revision ID: 8640dcbebf85
|
|
4
|
+
Revises: 71bc1df82e6a
|
|
5
|
+
Create Date: 2025-12-28 13:48:23.510558
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '8640dcbebf85'
|
|
18
|
+
down_revision: Union[str, None] = '71bc1df82e6a'
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
with op.batch_alter_table("users", schema=None) as batch_op:
|
|
25
|
+
batch_op.add_column(
|
|
26
|
+
sa.Column("notes", sqlmodel.sql.sqltypes.AutoString(), nullable=True)
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def downgrade() -> None:
|
|
31
|
+
with op.batch_alter_table("users", schema=None) as batch_op:
|
|
32
|
+
batch_op.drop_column("notes")
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""adding fk on owner_shortname
|
|
2
|
+
|
|
3
|
+
Revision ID: 91c94250232a
|
|
4
|
+
Revises: f7a4949eed19
|
|
5
|
+
Create Date: 2025-02-11 15:11:21.817512
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '91c94250232a'
|
|
18
|
+
down_revision: Union[str, None] = 'f7a4949eed19'
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
26
|
+
batch_op.alter_column('owner_shortname',
|
|
27
|
+
existing_type=sa.VARCHAR(),
|
|
28
|
+
nullable=False)
|
|
29
|
+
batch_op.create_unique_constraint(None, ['shortname'])
|
|
30
|
+
# batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
31
|
+
|
|
32
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
33
|
+
batch_op.alter_column('owner_shortname',
|
|
34
|
+
existing_type=sa.VARCHAR(),
|
|
35
|
+
nullable=False)
|
|
36
|
+
batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
37
|
+
|
|
38
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
39
|
+
batch_op.alter_column('owner_shortname',
|
|
40
|
+
existing_type=sa.VARCHAR(),
|
|
41
|
+
nullable=False)
|
|
42
|
+
batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
43
|
+
|
|
44
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
45
|
+
batch_op.alter_column('owner_shortname',
|
|
46
|
+
existing_type=sa.VARCHAR(),
|
|
47
|
+
nullable=False)
|
|
48
|
+
batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
49
|
+
|
|
50
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
51
|
+
batch_op.alter_column('owner_shortname',
|
|
52
|
+
existing_type=sa.VARCHAR(),
|
|
53
|
+
nullable=False)
|
|
54
|
+
batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
55
|
+
|
|
56
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
57
|
+
batch_op.alter_column('owner_shortname',
|
|
58
|
+
existing_type=sa.VARCHAR(),
|
|
59
|
+
nullable=False)
|
|
60
|
+
batch_op.create_foreign_key(None, 'users', ['owner_shortname'], ['shortname'])
|
|
61
|
+
|
|
62
|
+
# ### end Alembic commands ###
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def downgrade() -> None:
|
|
66
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
67
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
68
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
69
|
+
batch_op.drop_constraint(None, type_='unique')
|
|
70
|
+
batch_op.alter_column('owner_shortname',
|
|
71
|
+
existing_type=sa.VARCHAR(),
|
|
72
|
+
nullable=True)
|
|
73
|
+
|
|
74
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
75
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
76
|
+
batch_op.alter_column('owner_shortname',
|
|
77
|
+
existing_type=sa.VARCHAR(),
|
|
78
|
+
nullable=True)
|
|
79
|
+
|
|
80
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
81
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
82
|
+
batch_op.alter_column('owner_shortname',
|
|
83
|
+
existing_type=sa.VARCHAR(),
|
|
84
|
+
nullable=True)
|
|
85
|
+
|
|
86
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
87
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
88
|
+
batch_op.alter_column('owner_shortname',
|
|
89
|
+
existing_type=sa.VARCHAR(),
|
|
90
|
+
nullable=True)
|
|
91
|
+
|
|
92
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
93
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
94
|
+
batch_op.alter_column('owner_shortname',
|
|
95
|
+
existing_type=sa.VARCHAR(),
|
|
96
|
+
nullable=True)
|
|
97
|
+
|
|
98
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
99
|
+
batch_op.drop_constraint(None, type_='foreignkey')
|
|
100
|
+
batch_op.alter_column('owner_shortname',
|
|
101
|
+
existing_type=sa.VARCHAR(),
|
|
102
|
+
nullable=True)
|
|
103
|
+
|
|
104
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""ext meta with owner_group_shortname
|
|
2
|
+
|
|
3
|
+
Revision ID: 98ecd6f56f9a
|
|
4
|
+
Revises: 1cf4e1ee3cb8
|
|
5
|
+
Create Date: 2025-09-23 12:53:42.616843
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
import sqlmodel
|
|
13
|
+
import sqlmodel.sql.sqltypes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = '98ecd6f56f9a'
|
|
18
|
+
down_revision: Union[str, None] = '1cf4e1ee3cb8'
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
26
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
27
|
+
|
|
28
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
29
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
30
|
+
|
|
31
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
32
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
33
|
+
|
|
34
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
35
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
36
|
+
|
|
37
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
38
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
39
|
+
|
|
40
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
41
|
+
batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
|
42
|
+
|
|
43
|
+
# ### end Alembic commands ###
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def downgrade() -> None:
|
|
47
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
48
|
+
with op.batch_alter_table('users', schema=None) as batch_op:
|
|
49
|
+
batch_op.drop_column('owner_group_shortname')
|
|
50
|
+
|
|
51
|
+
with op.batch_alter_table('spaces', schema=None) as batch_op:
|
|
52
|
+
batch_op.drop_column('owner_group_shortname')
|
|
53
|
+
|
|
54
|
+
with op.batch_alter_table('roles', schema=None) as batch_op:
|
|
55
|
+
batch_op.drop_column('owner_group_shortname')
|
|
56
|
+
|
|
57
|
+
with op.batch_alter_table('permissions', schema=None) as batch_op:
|
|
58
|
+
batch_op.drop_column('owner_group_shortname')
|
|
59
|
+
|
|
60
|
+
with op.batch_alter_table('entries', schema=None) as batch_op:
|
|
61
|
+
batch_op.drop_column('owner_group_shortname')
|
|
62
|
+
|
|
63
|
+
with op.batch_alter_table('attachments', schema=None) as batch_op:
|
|
64
|
+
batch_op.drop_column('owner_group_shortname')
|
|
65
|
+
|
|
66
|
+
# ### end Alembic commands ###
|