zou 0.19.14__py3-none-any.whl → 0.20.11__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.
Files changed (165) hide show
  1. zou/__init__.py +1 -1
  2. zou/app/__init__.py +10 -2
  3. zou/app/api.py +2 -0
  4. zou/app/blueprints/assets/__init__.py +22 -0
  5. zou/app/blueprints/assets/resources.py +241 -4
  6. zou/app/blueprints/auth/__init__.py +4 -0
  7. zou/app/blueprints/auth/resources.py +154 -22
  8. zou/app/blueprints/breakdown/resources.py +4 -4
  9. zou/app/blueprints/chats/__init__.py +22 -0
  10. zou/app/blueprints/chats/resources.py +199 -0
  11. zou/app/blueprints/comments/resources.py +36 -19
  12. zou/app/blueprints/crud/__init__.py +12 -0
  13. zou/app/blueprints/crud/attachment_file.py +14 -5
  14. zou/app/blueprints/crud/base.py +29 -28
  15. zou/app/blueprints/crud/chat.py +13 -0
  16. zou/app/blueprints/crud/chat_message.py +13 -0
  17. zou/app/blueprints/crud/comments.py +85 -29
  18. zou/app/blueprints/crud/custom_action.py +1 -1
  19. zou/app/blueprints/crud/day_off.py +47 -9
  20. zou/app/blueprints/crud/department.py +1 -25
  21. zou/app/blueprints/crud/entity.py +46 -5
  22. zou/app/blueprints/crud/entity_type.py +13 -1
  23. zou/app/blueprints/crud/event.py +1 -1
  24. zou/app/blueprints/crud/file_status.py +1 -1
  25. zou/app/blueprints/crud/metadata_descriptor.py +24 -10
  26. zou/app/blueprints/crud/organisation.py +22 -5
  27. zou/app/blueprints/crud/output_file.py +1 -1
  28. zou/app/blueprints/crud/output_type.py +1 -1
  29. zou/app/blueprints/crud/person.py +32 -24
  30. zou/app/blueprints/crud/playlist.py +1 -1
  31. zou/app/blueprints/crud/preview_background_file.py +6 -7
  32. zou/app/blueprints/crud/preview_file.py +1 -1
  33. zou/app/blueprints/crud/project.py +14 -6
  34. zou/app/blueprints/crud/project_status.py +1 -1
  35. zou/app/blueprints/crud/schedule_item.py +4 -2
  36. zou/app/blueprints/crud/software.py +1 -1
  37. zou/app/blueprints/crud/status_automation.py +1 -1
  38. zou/app/blueprints/crud/studio.py +33 -0
  39. zou/app/blueprints/crud/task.py +47 -3
  40. zou/app/blueprints/crud/task_status.py +1 -1
  41. zou/app/blueprints/crud/task_type.py +4 -4
  42. zou/app/blueprints/crud/working_file.py +4 -8
  43. zou/app/blueprints/events/resources.py +13 -12
  44. zou/app/blueprints/export/csv/assets.py +15 -6
  45. zou/app/blueprints/export/csv/edits.py +15 -5
  46. zou/app/blueprints/export/csv/playlists.py +1 -1
  47. zou/app/blueprints/export/csv/shots.py +15 -5
  48. zou/app/blueprints/export/csv/time_spents.py +1 -1
  49. zou/app/blueprints/files/resources.py +22 -23
  50. zou/app/blueprints/index/resources.py +38 -29
  51. zou/app/blueprints/news/resources.py +25 -11
  52. zou/app/blueprints/persons/__init__.py +5 -2
  53. zou/app/blueprints/persons/resources.py +126 -120
  54. zou/app/blueprints/previews/__init__.py +18 -8
  55. zou/app/blueprints/previews/resources.py +569 -328
  56. zou/app/blueprints/projects/resources.py +1 -1
  57. zou/app/blueprints/search/resources.py +18 -6
  58. zou/app/blueprints/shots/__init__.py +5 -0
  59. zou/app/blueprints/shots/resources.py +134 -4
  60. zou/app/blueprints/source/__init__.py +6 -6
  61. zou/app/blueprints/source/csv/assets.py +10 -3
  62. zou/app/blueprints/source/csv/base.py +1 -1
  63. zou/app/blueprints/source/csv/edits.py +10 -3
  64. zou/app/blueprints/source/csv/shots.py +10 -3
  65. zou/app/blueprints/source/{edl.py → otio.py} +84 -41
  66. zou/app/blueprints/tasks/__init__.py +3 -2
  67. zou/app/blueprints/tasks/resources.py +83 -52
  68. zou/app/blueprints/user/__init__.py +9 -0
  69. zou/app/blueprints/user/resources.py +170 -12
  70. zou/app/config.py +10 -0
  71. zou/app/mixin.py +6 -5
  72. zou/app/models/attachment_file.py +10 -4
  73. zou/app/models/base.py +18 -13
  74. zou/app/models/build_job.py +7 -4
  75. zou/app/models/chat.py +44 -0
  76. zou/app/models/chat_message.py +37 -0
  77. zou/app/models/comment.py +1 -0
  78. zou/app/models/day_off.py +3 -0
  79. zou/app/models/entity.py +4 -6
  80. zou/app/models/entity_type.py +2 -0
  81. zou/app/models/organisation.py +14 -15
  82. zou/app/models/person.py +6 -1
  83. zou/app/models/project.py +3 -0
  84. zou/app/models/search_filter.py +11 -0
  85. zou/app/models/search_filter_group.py +10 -0
  86. zou/app/models/serializer.py +17 -17
  87. zou/app/models/status_automation.py +2 -0
  88. zou/app/models/studio.py +13 -0
  89. zou/app/models/subscription.py +2 -2
  90. zou/app/models/task.py +6 -1
  91. zou/app/models/task_status.py +1 -0
  92. zou/app/models/task_type.py +1 -0
  93. zou/app/models/working_file.py +1 -1
  94. zou/app/services/assets_service.py +101 -14
  95. zou/app/services/auth_service.py +17 -44
  96. zou/app/services/breakdown_service.py +37 -5
  97. zou/app/services/chats_service.py +279 -0
  98. zou/app/services/comments_service.py +110 -65
  99. zou/app/services/concepts_service.py +4 -12
  100. zou/app/services/deletion_service.py +43 -30
  101. zou/app/services/edits_service.py +5 -11
  102. zou/app/services/emails_service.py +4 -4
  103. zou/app/services/entities_service.py +17 -2
  104. zou/app/services/events_service.py +12 -4
  105. zou/app/services/exception.py +5 -5
  106. zou/app/services/names_service.py +7 -2
  107. zou/app/services/news_service.py +17 -9
  108. zou/app/services/persons_service.py +38 -21
  109. zou/app/services/playlists_service.py +8 -7
  110. zou/app/services/preview_files_service.py +137 -10
  111. zou/app/services/projects_service.py +5 -14
  112. zou/app/services/shots_service.py +221 -49
  113. zou/app/services/sync_service.py +46 -42
  114. zou/app/services/tasks_service.py +185 -46
  115. zou/app/services/time_spents_service.py +67 -20
  116. zou/app/services/user_service.py +350 -107
  117. zou/app/stores/auth_tokens_store.py +2 -1
  118. zou/app/stores/file_store.py +18 -0
  119. zou/app/stores/publisher_store.py +7 -7
  120. zou/app/stores/queue_store.py +1 -0
  121. zou/app/swagger.py +36 -20
  122. zou/app/utils/cache.py +2 -0
  123. zou/app/utils/commands.py +104 -7
  124. zou/app/utils/csv_utils.py +1 -4
  125. zou/app/utils/date_helpers.py +33 -17
  126. zou/app/utils/dbhelpers.py +14 -1
  127. zou/app/utils/emails.py +2 -2
  128. zou/app/utils/fido.py +22 -0
  129. zou/app/utils/flask.py +1 -0
  130. zou/app/utils/query.py +54 -6
  131. zou/app/utils/redis.py +11 -0
  132. zou/app/utils/saml.py +51 -0
  133. zou/app/utils/string.py +2 -0
  134. zou/app/utils/thumbnail.py +4 -2
  135. zou/cli.py +76 -18
  136. zou/debug.py +4 -2
  137. zou/event_stream.py +122 -165
  138. zou/job_settings.py +1 -0
  139. zou/migrations/env.py +0 -0
  140. zou/migrations/utils/base.py +6 -6
  141. zou/migrations/versions/1bb55759146f_add_table_studio.py +67 -0
  142. zou/migrations/versions/1fab8c420678_add_attachments_to_message_chats.py +56 -0
  143. zou/migrations/versions/23122f290ca2_add_entity_chat_models.py +149 -0
  144. zou/migrations/versions/32f134ff1201_add_is_shared_flag_to_filters.py +33 -0
  145. zou/migrations/versions/57222395f2be_add_statusautomation_import_last_revision.py +41 -0
  146. zou/migrations/versions/59a7445a966c_add_entity_is_shared.py +41 -0
  147. zou/migrations/versions/5b980f0dc365_add_comment_links.py +35 -0
  148. zou/migrations/versions/680c64565f9d_for_searchfiltergroup_is_shared.py +35 -0
  149. zou/migrations/versions/8e67c183bed7_add_preference_fields.py +71 -0
  150. zou/migrations/versions/92b40d79ad3f_allow_message_attachments.py +38 -0
  151. zou/migrations/versions/971dbf5a0faf_add_short_name_for_asset_type_entity_.py +33 -0
  152. zou/migrations/versions/9b85c14fa8a7_add_day_off_new_columns.py +68 -0
  153. zou/migrations/versions/9d3bb33c6fc6_add_department_keys_to_filter_models.py +73 -0
  154. zou/migrations/versions/a252a094e977_add_descriptions_for_entities_tasks_and_.py +40 -0
  155. zou/migrations/versions/be56dc0fb760_for_is_shared_disallow_nullable.py +102 -0
  156. zou/migrations/versions/ca28796a2a62_add_is_done_field_to_the_task_model.py +108 -0
  157. zou/migrations/versions/f344b867a911_for_description_of_entity_task_working_.py +75 -0
  158. zou/remote/config_payload.py +2 -1
  159. zou/utils/movie.py +14 -4
  160. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/METADATA +75 -69
  161. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/RECORD +164 -135
  162. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/WHEEL +1 -1
  163. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/LICENSE +0 -0
  164. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/entry_points.txt +0 -0
  165. {zou-0.19.14.dist-info → zou-0.20.11.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,67 @@
1
+ """Add table Studio
2
+
3
+ Revision ID: 1bb55759146f
4
+ Revises: be56dc0fb760
5
+ Create Date: 2024-05-31 15:30:17.189541
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+ import sqlalchemy_utils
12
+ import sqlalchemy_utils
13
+ import uuid
14
+
15
+ # revision identifiers, used by Alembic.
16
+ revision = "1bb55759146f"
17
+ down_revision = "be56dc0fb760"
18
+ branch_labels = None
19
+ depends_on = None
20
+
21
+
22
+ def upgrade():
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table(
25
+ "studio",
26
+ sa.Column("name", sa.String(length=80), nullable=False),
27
+ sa.Column("color", sa.String(length=7), nullable=False),
28
+ sa.Column("archived", sa.Boolean(), nullable=True),
29
+ sa.Column(
30
+ "id",
31
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
32
+ default=uuid.uuid4,
33
+ nullable=False,
34
+ ),
35
+ sa.Column("created_at", sa.DateTime(), nullable=True),
36
+ sa.Column("updated_at", sa.DateTime(), nullable=True),
37
+ sa.PrimaryKeyConstraint("id"),
38
+ sa.UniqueConstraint("name"),
39
+ )
40
+ with op.batch_alter_table("person", schema=None) as batch_op:
41
+ batch_op.add_column(
42
+ sa.Column(
43
+ "studio_id",
44
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
45
+ default=uuid.uuid4,
46
+ nullable=True,
47
+ )
48
+ )
49
+ batch_op.create_index(
50
+ batch_op.f("ix_person_studio_id"), ["studio_id"], unique=False
51
+ )
52
+ batch_op.create_foreign_key(
53
+ "person_studio_id_fkey", "studio", ["studio_id"], ["id"]
54
+ )
55
+
56
+ # ### end Alembic commands ###
57
+
58
+
59
+ def downgrade():
60
+ # ### commands auto generated by Alembic - please adjust! ###
61
+ with op.batch_alter_table("person", schema=None) as batch_op:
62
+ batch_op.drop_constraint("person_studio_id_fkey", type_="foreignkey")
63
+ batch_op.drop_index(batch_op.f("ix_person_studio_id"))
64
+ batch_op.drop_column("studio_id")
65
+
66
+ op.drop_table("studio")
67
+ # ### end Alembic commands ###
@@ -0,0 +1,56 @@
1
+ """add attachments to message chats
2
+
3
+
4
+ Revision ID: 1fab8c420678
5
+ Revises: 92b40d79ad3f
6
+ Create Date: 2024-03-28 13:22:39.592100
7
+
8
+ """
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+ import sqlalchemy_utils
13
+ import sqlalchemy_utils
14
+ import uuid
15
+
16
+ # revision identifiers, used by Alembic.
17
+ revision = "1fab8c420678"
18
+ down_revision = "92b40d79ad3f"
19
+ branch_labels = None
20
+ depends_on = None
21
+
22
+
23
+ def upgrade():
24
+ # ### commands auto generated by Alembic - please adjust! ###
25
+ with op.batch_alter_table("attachment_file", schema=None) as batch_op:
26
+ batch_op.add_column(
27
+ sa.Column(
28
+ "chat_message_id",
29
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
30
+ default=uuid.uuid4,
31
+ nullable=True,
32
+ )
33
+ )
34
+ batch_op.drop_constraint("attachment_uc", type_="unique")
35
+ batch_op.create_index(
36
+ batch_op.f("ix_attachment_file_chat_message_id"),
37
+ ["chat_message_id"],
38
+ unique=False,
39
+ )
40
+ batch_op.create_foreign_key(
41
+ None, "chat_message", ["chat_message_id"], ["id"]
42
+ )
43
+ # ### end Alembic commands ###
44
+
45
+
46
+ def downgrade():
47
+ # ### commands auto generated by Alembic - please adjust! ###
48
+ with op.batch_alter_table("attachment_file", schema=None) as batch_op:
49
+ batch_op.drop_constraint(None, type_="foreignkey")
50
+ batch_op.drop_index(batch_op.f("ix_attachment_file_chat_message_id"))
51
+ batch_op.create_unique_constraint(
52
+ "attachment_uc", ["name", "comment_id"]
53
+ )
54
+ batch_op.drop_column("chat_message_id")
55
+
56
+ # ### end Alembic commands ###
@@ -0,0 +1,149 @@
1
+ """add entity chat models
2
+
3
+ Revision ID: 23122f290ca2
4
+ Revises: 9b85c14fa8a7
5
+ Create Date: 2024-03-08 01:33:18.212645
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+ import sqlalchemy_utils
12
+ import sqlalchemy_utils
13
+ import uuid
14
+
15
+ # revision identifiers, used by Alembic.
16
+ revision = "23122f290ca2"
17
+ down_revision = "9b85c14fa8a7"
18
+ branch_labels = None
19
+ depends_on = None
20
+
21
+
22
+ def upgrade():
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table(
25
+ "chat",
26
+ sa.Column(
27
+ "object_id",
28
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
29
+ default=uuid.uuid4,
30
+ nullable=False,
31
+ ),
32
+ sa.Column("object_type", sa.String(length=80), nullable=False),
33
+ sa.Column("last_message", sa.DateTime(), nullable=True),
34
+ sa.Column(
35
+ "person_id",
36
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
37
+ default=uuid.uuid4,
38
+ nullable=False,
39
+ ),
40
+ sa.Column(
41
+ "id",
42
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
43
+ default=uuid.uuid4,
44
+ nullable=False,
45
+ ),
46
+ sa.Column("created_at", sa.DateTime(), nullable=True),
47
+ sa.Column("updated_at", sa.DateTime(), nullable=True),
48
+ sa.ForeignKeyConstraint(
49
+ ["person_id"],
50
+ ["person.id"],
51
+ ),
52
+ sa.PrimaryKeyConstraint("id"),
53
+ )
54
+ with op.batch_alter_table("chat", schema=None) as batch_op:
55
+ batch_op.create_index(
56
+ batch_op.f("ix_chat_object_id"), ["object_id"], unique=False
57
+ )
58
+ batch_op.create_index(
59
+ batch_op.f("ix_chat_object_type"), ["object_type"], unique=False
60
+ )
61
+ batch_op.create_index(
62
+ batch_op.f("ix_chat_person_id"), ["person_id"], unique=False
63
+ )
64
+
65
+ op.create_table(
66
+ "chat_message",
67
+ sa.Column(
68
+ "chat_id",
69
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
70
+ default=uuid.uuid4,
71
+ nullable=False,
72
+ ),
73
+ sa.Column(
74
+ "person_id",
75
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
76
+ default=uuid.uuid4,
77
+ nullable=False,
78
+ ),
79
+ sa.Column(
80
+ "id",
81
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
82
+ default=uuid.uuid4,
83
+ nullable=False,
84
+ ),
85
+ sa.Column("created_at", sa.DateTime(), nullable=True),
86
+ sa.Column("updated_at", sa.DateTime(), nullable=True),
87
+ sa.Column("text", sa.Text(), nullable=True),
88
+ sa.ForeignKeyConstraint(
89
+ ["chat_id"],
90
+ ["chat.id"],
91
+ ),
92
+ sa.ForeignKeyConstraint(
93
+ ["person_id"],
94
+ ["person.id"],
95
+ ),
96
+ sa.PrimaryKeyConstraint("id"),
97
+ )
98
+ with op.batch_alter_table("chat_message", schema=None) as batch_op:
99
+ batch_op.create_index(
100
+ batch_op.f("ix_chat_message_chat_id"), ["chat_id"], unique=False
101
+ )
102
+ batch_op.create_index(
103
+ batch_op.f("ix_chat_message_person_id"),
104
+ ["person_id"],
105
+ unique=False,
106
+ )
107
+
108
+ op.create_table(
109
+ "chat_participant",
110
+ sa.Column(
111
+ "chat_id",
112
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
113
+ default=uuid.uuid4,
114
+ nullable=False,
115
+ ),
116
+ sa.Column(
117
+ "person_id",
118
+ sqlalchemy_utils.types.uuid.UUIDType(binary=False),
119
+ default=uuid.uuid4,
120
+ nullable=False,
121
+ ),
122
+ sa.ForeignKeyConstraint(
123
+ ["chat_id"],
124
+ ["chat.id"],
125
+ ),
126
+ sa.ForeignKeyConstraint(
127
+ ["person_id"],
128
+ ["person.id"],
129
+ ),
130
+ sa.PrimaryKeyConstraint("chat_id", "person_id"),
131
+ )
132
+ # ### end Alembic commands ###
133
+
134
+
135
+ def downgrade():
136
+ # ### commands auto generated by Alembic - please adjust! ###
137
+ op.drop_table("chat_participant")
138
+ with op.batch_alter_table("chat_message", schema=None) as batch_op:
139
+ batch_op.drop_index(batch_op.f("ix_chat_message_person_id"))
140
+ batch_op.drop_index(batch_op.f("ix_chat_message_chat_id"))
141
+
142
+ op.drop_table("chat_message")
143
+ with op.batch_alter_table("chat", schema=None) as batch_op:
144
+ batch_op.drop_index(batch_op.f("ix_chat_person_id"))
145
+ batch_op.drop_index(batch_op.f("ix_chat_object_type"))
146
+ batch_op.drop_index(batch_op.f("ix_chat_object_id"))
147
+
148
+ op.drop_table("chat")
149
+ # ### end Alembic commands ###
@@ -0,0 +1,33 @@
1
+ """add is_shared flag to filters
2
+
3
+ Revision ID: 32f134ff1201
4
+ Revises: 57222395f2be
5
+ Create Date: 2024-05-17 00:50:00.493167
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "32f134ff1201"
15
+ down_revision = "57222395f2be"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("search_filter", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column("is_shared", sa.Boolean(), nullable=True)
25
+ )
26
+
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade():
31
+ # ### commands auto generated by Alembic - please adjust! ###
32
+ with op.batch_alter_table("search_filter", schema=None) as batch_op:
33
+ batch_op.drop_column("is_shared")
@@ -0,0 +1,41 @@
1
+ """Add StatusAutomation.import_last_revision
2
+
3
+ Revision ID: 57222395f2be
4
+ Revises: 5b980f0dc365
5
+ Create Date: 2024-05-07 01:23:21.597644
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "57222395f2be"
15
+ down_revision = "5b980f0dc365"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("status_automation", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column(
25
+ "import_last_revision",
26
+ sa.Boolean(),
27
+ nullable=True,
28
+ default=False,
29
+ server_default=sa.sql.expression.false(),
30
+ )
31
+ )
32
+
33
+ # ### end Alembic commands ###
34
+
35
+
36
+ def downgrade():
37
+ # ### commands auto generated by Alembic - please adjust! ###
38
+ with op.batch_alter_table("status_automation", schema=None) as batch_op:
39
+ batch_op.drop_column("import_last_revision")
40
+
41
+ # ### end Alembic commands ###
@@ -0,0 +1,41 @@
1
+ """Add Entity.is_shared
2
+
3
+ Revision ID: 59a7445a966c
4
+ Revises: ca28796a2a62
5
+ Create Date: 2024-08-16 17:31:59.331365
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+ from sqlalchemy.sql import expression
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision = "59a7445a966c"
16
+ down_revision = "ca28796a2a62"
17
+ branch_labels = None
18
+ depends_on = None
19
+
20
+
21
+ def upgrade():
22
+ # ### commands auto generated by Alembic - please adjust! ###
23
+ with op.batch_alter_table("entity", schema=None) as batch_op:
24
+ batch_op.add_column(
25
+ sa.Column(
26
+ "is_shared",
27
+ sa.Boolean(),
28
+ nullable=False,
29
+ server_default=expression.false(),
30
+ )
31
+ )
32
+
33
+ # ### end Alembic commands ###
34
+
35
+
36
+ def downgrade():
37
+ # ### commands auto generated by Alembic - please adjust! ###
38
+ with op.batch_alter_table("entity", schema=None) as batch_op:
39
+ batch_op.drop_column("is_shared")
40
+
41
+ # ### end Alembic commands ###
@@ -0,0 +1,35 @@
1
+ """Add Comment.links
2
+
3
+ Revision ID: 5b980f0dc365
4
+ Revises: 1fab8c420678
5
+ Create Date: 2024-05-06 16:42:35.512933
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "5b980f0dc365"
15
+ down_revision = "1fab8c420678"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("comment", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column("links", sa.ARRAY(sa.String()), nullable=True)
25
+ )
26
+
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade():
31
+ # ### commands auto generated by Alembic - please adjust! ###
32
+ with op.batch_alter_table("comment", schema=None) as batch_op:
33
+ batch_op.drop_column("links")
34
+
35
+ # ### end Alembic commands ###
@@ -0,0 +1,35 @@
1
+ """For SearchFilterGroup.is_shared
2
+
3
+ Revision ID: 680c64565f9d
4
+ Revises: f344b867a911
5
+ Create Date: 2024-05-29 02:13:20.764614
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "680c64565f9d"
15
+ down_revision = "f344b867a911"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("search_filter_group", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column("is_shared", sa.Boolean(), nullable=True)
25
+ )
26
+
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade():
31
+ # ### commands auto generated by Alembic - please adjust! ###
32
+ with op.batch_alter_table("search_filter_group", schema=None) as batch_op:
33
+ batch_op.drop_column("is_shared")
34
+
35
+ # ### end Alembic commands ###
@@ -0,0 +1,71 @@
1
+ """add prefeence fields
2
+
3
+ Revision ID: 8e67c183bed7
4
+ Revises: 59a7445a966c
5
+ Create Date: 2024-09-26 10:48:45.678791
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "8e67c183bed7"
15
+ down_revision = "59a7445a966c"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("organisation", schema=None) as batch_op:
23
+ batch_op.add_column(
24
+ sa.Column("dark_theme_by_default", sa.Boolean(), nullable=True)
25
+ )
26
+ batch_op.add_column(
27
+ sa.Column("format_duration_in_hours", sa.Boolean(), nullable=True)
28
+ )
29
+
30
+ with op.batch_alter_table("project", schema=None) as batch_op:
31
+ batch_op.add_column(
32
+ sa.Column(
33
+ "is_publish_default_for_artists", sa.Boolean(), nullable=True
34
+ )
35
+ )
36
+ batch_op.add_column(
37
+ sa.Column("hd_bitrate_compression", sa.Integer(), nullable=True)
38
+ )
39
+ batch_op.add_column(
40
+ sa.Column("ld_bitrate_compression", sa.Integer(), nullable=True)
41
+ )
42
+
43
+ with op.batch_alter_table("task", schema=None) as batch_op:
44
+ batch_op.add_column(
45
+ sa.Column(
46
+ "difficulty", sa.Integer(), nullable=False, server_default="3"
47
+ )
48
+ )
49
+ batch_op.create_check_constraint(
50
+ "check_difficulty", "difficulty > 0 AND difficulty < 6"
51
+ )
52
+
53
+ # ### end Alembic commands ###
54
+
55
+
56
+ def downgrade():
57
+ # ### commands auto generated by Alembic - please adjust! ###
58
+ with op.batch_alter_table("task", schema=None) as batch_op:
59
+ batch_op.drop_constraint("check_difficulty", type_="check")
60
+ batch_op.drop_column("difficulty")
61
+
62
+ with op.batch_alter_table("project", schema=None) as batch_op:
63
+ batch_op.drop_column("ld_bitrate_compression")
64
+ batch_op.drop_column("hd_bitrate_compression")
65
+ batch_op.drop_column("is_publish_default_for_artists")
66
+
67
+ with op.batch_alter_table("organisation", schema=None) as batch_op:
68
+ batch_op.drop_column("format_duration_in_hours")
69
+ batch_op.drop_column("dark_theme_by_default")
70
+
71
+ # ### end Alembic commands ###
@@ -0,0 +1,38 @@
1
+ """allow attachment on messages
2
+
3
+ Revision ID: 92b40d79ad3f
4
+ Revises: 23122f290ca2
5
+ Create Date: 2024-03-08 01:35:16.127135
6
+
7
+ """
8
+
9
+ from alembic import op
10
+
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "92b40d79ad3f"
14
+ down_revision = "23122f290ca2"
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade():
20
+ # ### commands auto generated by Alembic - please adjust! ###
21
+ with op.batch_alter_table("chat", schema=None) as batch_op:
22
+ batch_op.drop_index("ix_chat_person_id")
23
+ batch_op.drop_constraint("chat_person_id_fkey", type_="foreignkey")
24
+ batch_op.drop_column("person_id")
25
+
26
+ # ### end Alembic commands ###
27
+
28
+
29
+ def downgrade():
30
+ # ### commands auto generated by Alembic - please adjust! ###
31
+ """
32
+ with op.batch_alter_table('chat', schema=None) as batch_op:
33
+ batch_op.add_column(sa.Column('person_id', sa.UUID(), autoincrement=False, nullable=False))
34
+ batch_op.create_foreign_key('chat_person_id_fkey', 'person', ['person_id'], ['id'])
35
+ batch_op.create_index('ix_chat_person_id', ['person_id'], unique=False)
36
+ """
37
+
38
+ # ### end Alembic commands ###
@@ -0,0 +1,33 @@
1
+ """Add short_name for Asset Type entity_type
2
+
3
+ Revision ID: 971dbf5a0faf
4
+ Revises: a252a094e977
5
+ Create Date: 2024-06-20 19:51:15.758780
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "971dbf5a0faf"
15
+ down_revision = "a252a094e977"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade():
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ op.add_column(
23
+ "entity_type",
24
+ sa.Column("short_name", sa.String(length=20), nullable=True),
25
+ )
26
+
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade():
31
+ # ### commands auto generated by Alembic - please adjust! ###
32
+ op.drop_column("entity_type", "short_name")
33
+ # ### end Alembic commands ###
@@ -0,0 +1,68 @@
1
+ """Add day_off new columns
2
+
3
+ Revision ID: 9b85c14fa8a7
4
+ Revises: 16328eae4b5f
5
+ Create Date: 2024-02-23 14:48:48.461237
6
+
7
+ """
8
+
9
+ from alembic import op
10
+ import sqlalchemy as sa
11
+ from sqlalchemy.orm.session import Session
12
+ from zou.migrations.utils.base import BaseMixin
13
+ from sqlalchemy.ext.declarative import declarative_base
14
+ from sqlalchemy_utils import UUIDType
15
+
16
+
17
+ # revision identifiers, used by Alembic.
18
+ revision = "9b85c14fa8a7"
19
+ down_revision = "16328eae4b5f"
20
+ branch_labels = None
21
+ depends_on = None
22
+
23
+ base = declarative_base()
24
+
25
+
26
+ class DayOff(base, BaseMixin):
27
+ """
28
+ Tells that someone will have a day off this day.
29
+ """
30
+
31
+ __tablename__ = "day_off"
32
+ date = sa.Column(sa.Date, nullable=False)
33
+ end_date = sa.Column(sa.Date, nullable=True)
34
+ description = sa.Column(sa.Text)
35
+ person_id = sa.Column(
36
+ UUIDType(binary=False), sa.ForeignKey("person.id"), index=True
37
+ )
38
+ __table_args__ = (
39
+ sa.UniqueConstraint("person_id", "date", name="day_off_uc"),
40
+ sa.CheckConstraint("date <= end_date", name="day_off_date_check"),
41
+ )
42
+
43
+
44
+ def upgrade():
45
+ # ### commands auto generated by Alembic - please adjust! ###
46
+ with op.batch_alter_table("day_off", schema=None) as batch_op:
47
+ batch_op.add_column(sa.Column("end_date", sa.Date(), nullable=True))
48
+ batch_op.add_column(sa.Column("description", sa.Text(), nullable=True))
49
+ batch_op.create_check_constraint(
50
+ "day_off_date_check", "date <= end_date"
51
+ )
52
+ session = Session(bind=op.get_bind())
53
+ session.query(DayOff).update({DayOff.end_date: DayOff.date})
54
+ session.commit()
55
+ with op.batch_alter_table("day_off", schema=None) as batch_op:
56
+ batch_op.alter_column("end_date", nullable=False)
57
+
58
+ # ### end Alembic commands ###
59
+
60
+
61
+ def downgrade():
62
+ # ### commands auto generated by Alembic - please adjust! ###
63
+ with op.batch_alter_table("day_off", schema=None) as batch_op:
64
+ batch_op.drop_constraint("day_off_date_check", type_="check")
65
+ batch_op.drop_column("description")
66
+ batch_op.drop_column("end_date")
67
+
68
+ # ### end Alembic commands ###