-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
15 changed files
with
317 additions
and
20 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
backend/alembic/versions/5e84129c8be3_add_docs_indexed_column_to_index_.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 @@ | ||
"""Add docs_indexed_column + time_started to index_attempt table | ||
Revision ID: 5e84129c8be3 | ||
Revises: e6a4bbc13fe4 | ||
Create Date: 2023-08-10 21:43:09.069523 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5e84129c8be3" | ||
down_revision = "e6a4bbc13fe4" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column( | ||
"index_attempt", | ||
sa.Column("num_docs_indexed", sa.Integer()), | ||
) | ||
op.add_column( | ||
"index_attempt", | ||
sa.Column( | ||
"time_started", | ||
sa.DateTime(timezone=True), | ||
nullable=True, | ||
), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("index_attempt", "time_started") | ||
op.drop_column("index_attempt", "num_docs_indexed") |
32 changes: 32 additions & 0 deletions
32
backend/alembic/versions/e6a4bbc13fe4_add_index_for_retrieving_latest_index_.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,32 @@ | ||
"""Add index for retrieving latest index_attempt | ||
Revision ID: e6a4bbc13fe4 | ||
Revises: b082fec533f0 | ||
Create Date: 2023-08-10 12:37:23.335471 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e6a4bbc13fe4" | ||
down_revision = "b082fec533f0" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.create_index( | ||
op.f("ix_index_attempt_latest_for_connector_credential_pair"), | ||
"index_attempt", | ||
["connector_id", "credential_id", "time_created"], | ||
unique=False, | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_index( | ||
op.f("ix_index_attempt_latest_for_connector_credential_pair"), | ||
table_name="index_attempt", | ||
) |
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
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
Oops, something went wrong.