|
| 1 | +"""cognition chat integration |
| 2 | +
|
| 3 | +Revision ID: 6b7c123b3e52 |
| 4 | +Revises: f6bca8990840 |
| 5 | +Create Date: 2024-01-05 12:29:28.774072 |
| 6 | +
|
| 7 | +""" |
| 8 | +from alembic import op |
| 9 | +import sqlalchemy as sa |
| 10 | + |
| 11 | + |
| 12 | +# revision identifiers, used by Alembic. |
| 13 | +revision = "6b7c123b3e52" |
| 14 | +down_revision = "f6bca8990840" |
| 15 | +branch_labels = None |
| 16 | +depends_on = None |
| 17 | + |
| 18 | + |
| 19 | +def upgrade(): |
| 20 | + # ### commands auto generated by Alembic - please adjust! ### |
| 21 | + op.add_column("user", sa.Column("language_display", sa.String(), nullable=True)) |
| 22 | + op.add_column( |
| 23 | + "conversation", |
| 24 | + sa.Column("header", sa.String(), nullable=True), |
| 25 | + schema="cognition", |
| 26 | + ) |
| 27 | + op.add_column( |
| 28 | + "conversation", |
| 29 | + sa.Column("error", sa.String(), nullable=True), |
| 30 | + schema="cognition", |
| 31 | + ) |
| 32 | + op.add_column( |
| 33 | + "message", |
| 34 | + sa.Column("selection_widget", sa.ARRAY(sa.JSON()), nullable=True), |
| 35 | + schema="cognition", |
| 36 | + ) |
| 37 | + op.add_column( |
| 38 | + "message", |
| 39 | + sa.Column("feedback_value", sa.String(), nullable=True), |
| 40 | + schema="cognition", |
| 41 | + ) |
| 42 | + op.add_column( |
| 43 | + "message", |
| 44 | + sa.Column("feedback_category", sa.String(), nullable=True), |
| 45 | + schema="cognition", |
| 46 | + ) |
| 47 | + op.drop_column("message", "positive_feedback", schema="cognition") |
| 48 | + op.add_column( |
| 49 | + "pipeline_logs", |
| 50 | + sa.Column("skipped_step", sa.Boolean(), nullable=True), |
| 51 | + schema="cognition", |
| 52 | + ) |
| 53 | + op.add_column( |
| 54 | + "project", |
| 55 | + sa.Column("interface_type", sa.String(), nullable=True), |
| 56 | + schema="cognition", |
| 57 | + ) |
| 58 | + op.add_column( |
| 59 | + "project", |
| 60 | + sa.Column( |
| 61 | + "execute_query_enrichment_if_source_code", sa.String(), nullable=True |
| 62 | + ), |
| 63 | + schema="cognition", |
| 64 | + ) |
| 65 | + op.add_column( |
| 66 | + "project", |
| 67 | + sa.Column("customer_color_primary", sa.String(), nullable=True), |
| 68 | + schema="cognition", |
| 69 | + ) |
| 70 | + op.add_column( |
| 71 | + "project", |
| 72 | + sa.Column("customer_color_primary_only_accent", sa.Boolean(), nullable=True), |
| 73 | + schema="cognition", |
| 74 | + ) |
| 75 | + op.add_column( |
| 76 | + "project", |
| 77 | + sa.Column("customer_color_secondary", sa.String(), nullable=True), |
| 78 | + schema="cognition", |
| 79 | + ) |
| 80 | + op.add_column( |
| 81 | + "strategy_step", |
| 82 | + sa.Column("progress_text", sa.String(), nullable=True), |
| 83 | + schema="cognition", |
| 84 | + ) |
| 85 | + op.add_column( |
| 86 | + "strategy_step", |
| 87 | + sa.Column("execute_if_source_code", sa.String(), nullable=True), |
| 88 | + schema="cognition", |
| 89 | + ) |
| 90 | + # ### end Alembic commands ### |
| 91 | + |
| 92 | + |
| 93 | +def downgrade(): |
| 94 | + # ### commands auto generated by Alembic - please adjust! ### |
| 95 | + op.drop_column("strategy_step", "execute_if_source_code", schema="cognition") |
| 96 | + op.drop_column("strategy_step", "progress_text", schema="cognition") |
| 97 | + op.drop_column("project", "customer_color_secondary", schema="cognition") |
| 98 | + op.drop_column("project", "customer_color_primary_only_accent", schema="cognition") |
| 99 | + op.drop_column("project", "customer_color_primary", schema="cognition") |
| 100 | + op.drop_column( |
| 101 | + "project", "execute_query_enrichment_if_source_code", schema="cognition" |
| 102 | + ) |
| 103 | + op.drop_column("project", "interface_type", schema="cognition") |
| 104 | + op.drop_column("pipeline_logs", "skipped_step", schema="cognition") |
| 105 | + op.add_column( |
| 106 | + "message", |
| 107 | + sa.Column( |
| 108 | + "positive_feedback", sa.BOOLEAN(), autoincrement=False, nullable=True |
| 109 | + ), |
| 110 | + schema="cognition", |
| 111 | + ) |
| 112 | + op.drop_column("message", "feedback_category", schema="cognition") |
| 113 | + op.drop_column("message", "feedback_value", schema="cognition") |
| 114 | + op.drop_column("message", "selection_widget", schema="cognition") |
| 115 | + op.drop_column("conversation", "error", schema="cognition") |
| 116 | + op.drop_column("conversation", "header", schema="cognition") |
| 117 | + op.drop_column("user", "language_display") |
| 118 | + # ### end Alembic commands ### |
0 commit comments