-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
256 changed files
with
10,892 additions
and
5,060 deletions.
There are no files selected for viewing
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
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
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
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
37 changes: 37 additions & 0 deletions
37
backend/alembic/versions/30c1d5744104_persona_datetime_aware.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,37 @@ | ||
"""Persona Datetime Aware | ||
Revision ID: 30c1d5744104 | ||
Revises: 7f99be1cb9f5 | ||
Create Date: 2023-10-16 23:21:01.283424 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "30c1d5744104" | ||
down_revision = "7f99be1cb9f5" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column("persona", sa.Column("datetime_aware", sa.Boolean(), nullable=True)) | ||
op.execute("UPDATE persona SET datetime_aware = TRUE") | ||
op.alter_column("persona", "datetime_aware", nullable=False) | ||
op.create_index( | ||
"_default_persona_name_idx", | ||
"persona", | ||
["name"], | ||
unique=True, | ||
postgresql_where=sa.text("default_persona = true"), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_index( | ||
"_default_persona_name_idx", | ||
table_name="persona", | ||
postgresql_where=sa.text("default_persona = true"), | ||
) | ||
op.drop_column("persona", "datetime_aware") |
49 changes: 49 additions & 0 deletions
49
backend/alembic/versions/3b25685ff73c_move_is_public_to_cc_pair.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,49 @@ | ||
"""Move is_public to cc_pair | ||
Revision ID: 3b25685ff73c | ||
Revises: e0a68a81d434 | ||
Create Date: 2023-10-05 18:47:09.582849 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "3b25685ff73c" | ||
down_revision = "e0a68a81d434" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column( | ||
"connector_credential_pair", | ||
sa.Column("is_public", sa.Boolean(), nullable=True), | ||
) | ||
# fill in is_public for existing rows | ||
op.execute( | ||
"UPDATE connector_credential_pair SET is_public = true WHERE is_public IS NULL" | ||
) | ||
op.alter_column("connector_credential_pair", "is_public", nullable=False) | ||
|
||
op.add_column( | ||
"credential", | ||
sa.Column("is_admin", sa.Boolean(), nullable=True), | ||
) | ||
op.execute("UPDATE credential SET is_admin = true WHERE is_admin IS NULL") | ||
op.alter_column("credential", "is_admin", nullable=False) | ||
|
||
op.drop_column("credential", "public_doc") | ||
|
||
|
||
def downgrade() -> None: | ||
op.add_column( | ||
"credential", | ||
sa.Column("public_doc", sa.Boolean(), nullable=True), | ||
) | ||
# setting public_doc to false for all existing rows to be safe | ||
# NOTE: this is likely not the correct state of the world but it's the best we can do | ||
op.execute("UPDATE credential SET public_doc = false WHERE public_doc IS NULL") | ||
op.alter_column("credential", "public_doc", nullable=False) | ||
op.drop_column("connector_credential_pair", "is_public") | ||
op.drop_column("credential", "is_admin") |
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.