|
| 1 | +"""ods-gitstat |
| 2 | +
|
| 3 | +Revision ID: 3c2c26d09969 |
| 4 | +Revises: 1d108dc04935 |
| 5 | +Create Date: 2025-05-22 13:36:04.211966 |
| 6 | +
|
| 7 | +""" |
| 8 | + |
| 9 | +import os |
| 10 | + |
| 11 | +import sqlalchemy as sa |
| 12 | +from alembic import op |
| 13 | + |
| 14 | + |
| 15 | +# revision identifiers, used by Alembic. |
| 16 | +revision = '3c2c26d09969' |
| 17 | +down_revision = '1d108dc04935' |
| 18 | +branch_labels = None |
| 19 | +depends_on = None |
| 20 | + |
| 21 | + |
| 22 | +def upgrade(): |
| 23 | + op.create_table( |
| 24 | + 'git_hub', |
| 25 | + sa.Column('uuid', sa.Uuid(), nullable=False, comment='Техническое поле в dwh'), |
| 26 | + sa.Column('status', sa.String(), nullable=False, comment='Статус issue'), |
| 27 | + sa.Column('url', sa.String(), nullable=False, comment='Ссылка на issue'), |
| 28 | + sa.Column('issue_id', sa.Integer(), nullable=True, comment='Идентификатор issue'), |
| 29 | + sa.Column('user_id', sa.Integer(), nullable=True, comment='Идентификатор пользователя открывшего issue'), |
| 30 | + sa.Column('user_login', sa.String(), nullable=True, comment='Логин пользователя открывшего issue'), |
| 31 | + sa.Column('issue_title', sa.String(), nullable=True, comment='Название issue'), |
| 32 | + sa.Column('repository_id', sa.Integer(), nullable=True, comment='Идентификатор репозитория'), |
| 33 | + sa.Column('assignee_id', sa.Integer(), nullable=True, comment='Идентификатор назначенного исполнителем issue'), |
| 34 | + sa.Column('assignee_login', sa.Integer(), nullable=True, comment='Логин назначенного исполнителем issue'), |
| 35 | + sa.Column('created_at', sa.DateTime(), nullable=True, comment='Временная метка создания issue'), |
| 36 | + sa.Column('updated_at', sa.DateTime(), nullable=True, comment='Временная метка апдейта issue'), |
| 37 | + sa.Column('closed_at', sa.DateTime(), nullable=True, comment='Временная метка закрытия issue'), |
| 38 | + sa.Column('organization_id', sa.Integer(), nullable=False, comment='Идентификатор организации'), |
| 39 | + sa.Column('organizatin_login', sa.String(), nullable=True, comment='Логин организации'), |
| 40 | + sa.Column('event_ts', sa.DateTime(), nullable=False, comment='Временная метка данного события'), |
| 41 | + sa.PrimaryKeyConstraint('uuid'), |
| 42 | + schema='ODS_SOCIAL', |
| 43 | + comment='\n Статистика GitHub\n ', |
| 44 | + info={'sensitive': False}, |
| 45 | + ) |
| 46 | + |
| 47 | + |
| 48 | +def downgrade(): |
| 49 | + op.drop_table('git_hub', schema='ODS_SOCIAL') |
0 commit comments