Repository: profcomff/dwh-definitions
Pull request #152: drop-table-rental
Author: login: VladislavVoskoboinik
Created: 2025-05-08T23:59:54Z | Merged: 2025-05-09T10:24:34Z

## Изменения
<!-- Опишите здесь на языке, понятном каждому, изменения, сделанные в исходном коде по пунктам. -->
fix табличек rental.py
Удаление лишней таблицы
## Детали реализации
<!-- Здесь можно описать технические детали по пунктам. -->

## Check-List
<!-- После сохранения у следующих полей появятся галочки, которые нужно проставить мышкой -->
- [ ] Вы проверили свой код перед отправкой запроса?
- [ ] Вы написали тесты к реализованным функциям?
- [ ] Вы не забыли применить форматирование `black` и `isort` для _Back-End_ или `Prettier` для _Front-End_?



Diff:
diff --git a/migrations/versions/20250509_1311_1d108dc04935_drop_table_dwh_rental.py b/migrations/versions/20250509_1311_1d108dc04935_drop_table_dwh_rental.py
new file mode 100644
index 0000000..1842257
--- /dev/null
+++ b/migrations/versions/20250509_1311_1d108dc04935_drop_table_dwh_rental.py
@@ -0,0 +1,46 @@
+"""drop_table_dwh_rental
+
+Revision ID: 1d108dc04935
+Revises: 83a86d9e5c9b
+Create Date: 2025-05-09 13:11:08.101214
+
+"""
+
+import os
+
+import sqlalchemy as sa
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+
+# revision identifiers, used by Alembic.
+revision = '1d108dc04935'
+down_revision = '83a86d9e5c9b'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    op.drop_table('rating_actions', schema='ODS_RENTAL')
+
+
+def downgrade():
+    op.create_table(
+        'rating_actions',
+        sa.Column('uuid', sa.UUID(), autoincrement=False, nullable=False),
+        sa.Column('action', sa.VARCHAR(), autoincrement=False, nullable=False, comment='Совершенное действие'),
+        sa.Column('path_to', sa.VARCHAR(), autoincrement=False, nullable=True, comment='Назначение перехода'),
+        sa.Column('response_status_code', sa.INTEGER(), autoincrement=False, nullable=False),
+        sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False),
+        sa.Column('query', sa.VARCHAR(), autoincrement=False, nullable=False, comment='Переданные параметры запроса'),
+        sa.Column(
+            'create_ts',
+            postgresql.TIMESTAMP(),
+            autoincrement=False,
+            nullable=False,
+            comment='Таймстемп создания (московское время)',
+        ),
+        sa.PrimaryKeyConstraint('uuid', name='rating_actions_pkey'),
+        schema='ODS_RENTAL',
+        comment='\n    События в рейтинге\n    ',
+    )
diff --git a/profcomff_definitions/ODS/rental.py b/profcomff_definitions/ODS/rental.py
index 72715bd..52d33b9 100644
--- a/profcomff_definitions/ODS/rental.py
+++ b/profcomff_definitions/ODS/rental.py
@@ -74,17 +74,4 @@ class Strike(Base):
     admin_id: Mapped[int] = mapped_column(comment="Идентификаор админа")
     reason: Mapped[str] = mapped_column(comment="Причина страйка")
     create_ts: Mapped[datetime] = mapped_column(comment="Timestamp страйка, мск")
-
-
-class RatingActions(Base):
-    """
-    События в рейтинге
-    """
-
-    uuid: Mapped[UUID] = mapped_column(primary_key=True)
-    action: Mapped[str] = mapped_column(comment="Совершенное действие")
-    path_to: Mapped[str | None] = mapped_column(comment="Назначение перехода")
-    response_status_code: Mapped[int]
-    user_id: Mapped[int]
-    query: Mapped[str] = mapped_column(comment="Переданные параметры запроса")
-    create_ts: Mapped[datetime] = mapped_column(comment="Таймстемп создания (московское время)")
+    
\ No newline at end of file


Reviews:
user: login: parfenovma
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T03:44:53Z
user: login: VladislavVoskoboinik
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T08:23:09Z
user: login: parfenovma
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T10:22:44Z

Review comments:
diff_hunk: @@ -0,0 +1,31 @@
+"""fix-rental
+
+Revision ID: cbbfd63d5260
+Revises: 83a86d9e5c9b
+Create Date: 2025-05-09 02:53:53.444154
+
+"""
+
+import os
+
+import sqlalchemy as sa
+from alembic import op
+
+
+# revision identifiers, used by Alembic.
+revision = 'cbbfd63d5260'
+down_revision = '83a86d9e5c9b'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    pass
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    pass
+    # ### end Alembic commands ###
path: migrations/versions/20250509_0253_cbbfd63d5260_fix_rental.py
user: login: parfenovma
body: вот тут по идее должна быть миграция с drop_table
created_at: 2025-05-09T03:44:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,31 @@
+"""fix-rental
+
+Revision ID: cbbfd63d5260
+Revises: 83a86d9e5c9b
+Create Date: 2025-05-09 02:53:53.444154
+
+"""
+
+import os
+
+import sqlalchemy as sa
+from alembic import op
+
+
+# revision identifiers, used by Alembic.
+revision = 'cbbfd63d5260'
+down_revision = '83a86d9e5c9b'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    pass
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    pass
+    # ### end Alembic commands ###
path: migrations/versions/20250509_0253_cbbfd63d5260_fix_rental.py
user: login: VladislavVoskoboinik
body: Должна, фиксану
created_at: 2025-05-09T08:23:09Z
author_association: CONTRIBUTOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-05-09T00:01:03Z
body: <!-- Pytest Coverage Comment: test -->
## Summary
| Tests | Skipped | Failures | Errors | Time |
| ----- | ------- | -------- | -------- | ------------------ |
| 1 | 0 :zzz: | 0 :x: | 0 :fire: | 14.360s :stopwatch: |

author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-09T10:16:47Z
body: :poop: Code linting failed, use `black` and `isort` to fix it.
author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-09T10:19:01Z
body: :poop: Code linting failed, use `black` and `isort` to fix it.
author_association: NONE