-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip Fix #1333 Forms Questions during plan sign up
- Loading branch information
1 parent
ae67112
commit 86a223d
Showing
26 changed files
with
1,076 additions
and
40 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
migrations/versions/063ddc60bef1_association_table_plan_question.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""association_table_plan_question | ||
Revision ID: 063ddc60bef1 | ||
Revises: c5bec71f1499 | ||
Create Date: 2024-05-09 22:00:42.022150 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "063ddc60bef1" | ||
down_revision = "c5bec71f1499" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"plan_question_associations", | ||
sa.Column("question_id", sa.Integer(), nullable=True), | ||
sa.Column("plan_id", sa.Integer(), nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["plan_id"], | ||
["plan.id"], | ||
), | ||
sa.ForeignKeyConstraint( | ||
["question_id"], | ||
["question.id"], | ||
), | ||
) | ||
|
||
|
||
def downgrade(): | ||
pass |
25 changes: 25 additions & 0 deletions
25
migrations/versions/3a54f4b1187d_add_order_to_association_table_plan_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""add order to association_table_plan_question | ||
Revision ID: 3a54f4b1187d | ||
Revises: 1d4b6d333c16 | ||
Create Date: 2024-05-19 18:13:11.397272 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "3a54f4b1187d" | ||
down_revision = "1d4b6d333c16" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("plan_question_associations", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("order", sa.Integer(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
pass |
26 changes: 26 additions & 0 deletions
26
migrations/versions/57b068821280_add_primary_plan_question_associations.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""add primary plan_question_associations | ||
Revision ID: 57b068821280 | ||
Revises: 3a54f4b1187d | ||
Create Date: 2024-05-19 19:58:41.527688 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "57b068821280" | ||
down_revision = "3a54f4b1187d" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("plan_question_associations", schema=None) as batch_op: | ||
batch_op.alter_column("question_id", existing_type=sa.INTEGER(), nullable=False) | ||
batch_op.alter_column("plan_id", existing_type=sa.INTEGER(), nullable=False) | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""add question table | ||
Revision ID: c5bec71f1499 | ||
Revises: bb76d2149316 | ||
Create Date: 2024-05-08 21:30:41.805887 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c5bec71f1499" | ||
down_revision = "bb76d2149316" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"question", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("uuid", sa.String(), nullable=False), | ||
sa.Column("created_at", sa.DateTime(), nullable=False), | ||
sa.Column("title", sa.String(), nullable=False), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""add answer model | ||
Revision ID: c70cd4900c96 | ||
Revises: 063ddc60bef1 | ||
Create Date: 2024-05-14 21:18:13.745275 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c70cd4900c96" | ||
down_revision = "063ddc60bef1" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"answer", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("created_at", sa.DateTime(), nullable=True), | ||
sa.Column("question_id", sa.Integer(), nullable=True), | ||
sa.Column("question_title", sa.String(), nullable=True), | ||
sa.Column("response", sa.String(), nullable=True), | ||
sa.Column("subscription_id", sa.Integer(), nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["subscription_id"], | ||
["subscription.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
|
||
|
||
def downgrade(): | ||
pass |
42 changes: 42 additions & 0 deletions
42
migrations/versions/c7a493cd99d4_create_questionoption_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""create QuestionOption model | ||
Revision ID: c7a493cd99d4 | ||
Revises: c70cd4900c96 | ||
Create Date: 2024-05-18 20:02:36.104426 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c7a493cd99d4" | ||
down_revision = "c70cd4900c96" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"question_option", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("question_id", sa.Integer(), nullable=True), | ||
sa.Column("created_at", sa.DateTime(), nullable=True), | ||
sa.Column("title", sa.String(), nullable=True), | ||
sa.Column("description", sa.Text(), nullable=True), | ||
sa.Column("primary_icon", sa.String(), nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["question_id"], | ||
["question.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
|
||
with op.batch_alter_table("question", schema=None) as batch_op: | ||
batch_op.alter_column("uuid", existing_type=sa.VARCHAR(), nullable=True) | ||
batch_op.alter_column("created_at", existing_type=sa.DATETIME(), nullable=True) | ||
batch_op.alter_column("title", existing_type=sa.VARCHAR(), nullable=True) | ||
|
||
|
||
def downgrade(): | ||
pass |
26 changes: 26 additions & 0 deletions
26
migrations/versions/da154873f3ab_add_created_at_uuid_to_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""add created_at uuid to PlanQuestionAssociation | ||
Revision ID: da154873f3ab | ||
Revises: 57b068821280 | ||
Create Date: 2024-05-19 21:59:10.555714 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "da154873f3ab" | ||
down_revision = "57b068821280" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("plan_question_associations", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("created_at", sa.DateTime(), nullable=True)) | ||
batch_op.add_column(sa.Column("uuid", sa.String(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.