Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

"""

from alembic import op
import sqlalchemy as sa
import os
from alembic import op


# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

"""

from alembic import op
import sqlalchemy as sa
import os

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'f8908a4837a5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

"""

from alembic import op
import sqlalchemy as sa
import os
from alembic import op


# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

"""

from alembic import op
import sqlalchemy as sa
import os

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '2685b42bfef5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

"""

from alembic import op
import sqlalchemy as sa
import os
from alembic import op
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = '40d72f2dd950'
down_revision = '2685b42bfef5'
Expand Down
4 changes: 2 additions & 2 deletions migrations/versions/20250416_0827_d43d62fb3748_fix_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"""

from alembic import op
import sqlalchemy as sa
import os

Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Import statements have been reordered and blank lines inserted inconsistently across migration scripts; standardize import grouping and formatting for consistency.

Suggested change

Copilot uses AI. Check for mistakes.
from alembic import op


# revision identifiers, used by Alembic.
revision = 'd43d62fb3748'
Expand Down
50 changes: 50 additions & 0 deletions migrations/versions/20250419_1938_e8f40f2847f7_incremental_dag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""incremental dag

Revision ID: e8f40f2847f7
Revises: d43d62fb3748
Create Date: 2025-04-19 19:38:15.637634

"""

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'e8f40f2847f7'
down_revision = 'd43d62fb3748'
branch_labels = None
depends_on = None


def upgrade():
op.create_table(
'actions_info_incremental',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('action', sa.String(), nullable=True),
sa.Column('path_from', sa.String(), nullable=True),
sa.Column('path_to', sa.String(), nullable=True),
sa.Column('additional_data', sa.String(), nullable=True),
sa.Column('create_ts', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
schema='STG_MARKETING',
info={'sensitive': False},
)
op.create_table(
'user_incremental',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('union_number', sa.String(), nullable=True),
sa.Column('user_agent', sa.String(), nullable=True),
sa.Column('auth_user_id', sa.Integer(), nullable=True),
sa.Column('modify_ts', sa.DateTime(), nullable=True),
sa.Column('create_ts', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
schema='STG_MARKETING',
info={'sensitive': False},
)


def downgrade():
op.drop_table('user_incremental', schema='STG_MARKETING')
op.drop_table('actions_info_incremental', schema='STG_MARKETING')
19 changes: 19 additions & 0 deletions profcomff_definitions/STG/marketing.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@ class ActionsInfo(Base):
path_to: Mapped[str | None]
additional_data: Mapped[str | None]
create_ts: Mapped[datetime | None]


class UserIncremental(Base):
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a docstring to the UserIncremental model to explain its purpose and fields, improving code readability.

Suggested change
class UserIncremental(Base):
class UserIncremental(Base):
"""
Represents incremental updates to user data.
Fields:
id (int): Primary key for the record.
union_number (str | None): A unique identifier for the user within a union, if applicable.
user_agent (str | None): The user agent string associated with the user.
auth_user_id (int | None): The ID of the authenticated user, if available.
modify_ts (datetime | None): The timestamp of the last modification to the record.
create_ts (datetime | None): The timestamp when the record was created.
"""

Copilot uses AI. Check for mistakes.
id: Mapped[int] = mapped_column(primary_key=True)
union_number: Mapped[str | None]
user_agent: Mapped[str | None]
auth_user_id: Mapped[int | None]
modify_ts: Mapped[datetime | None]
create_ts: Mapped[datetime | None]


class ActionsInfoIncremental(Base):
id: Mapped[int] = mapped_column(primary_key=True)
user_id: Mapped[int | None]
action: Mapped[str | None]
path_from: Mapped[str | None]
path_to: Mapped[str | None]
additional_data: Mapped[str | None]
create_ts: Mapped[datetime | None]
Loading