This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
forked from MDGrey33/Nur
-
Notifications
You must be signed in to change notification settings - Fork 0
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
27 changed files
with
377 additions
and
139 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 was deleted.
Oops, something went wrong.
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,8 @@ | ||
### Alembic documentation | ||
https://alembic.sqlalchemy.org/en/latest/ | ||
|
||
### Cookbook | ||
https://alembic.sqlalchemy.org/en/latest/cookbook.html#rudimental-schema-level-multi-tenancy-for-postgresql-databases | ||
|
||
Notes: | ||
- we set `DB_URL` in `.env` file and rewrite it in `alembic/env.py` file (`alembic.ini` file is not used of security reasons) |
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
30 changes: 30 additions & 0 deletions
30
alembic/versions/2024_04_12_1354-713caec2649e_initial_migration.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,30 @@ | ||
"""Initial migration | ||
Revision ID: 713caec2649e | ||
Revises: | ||
Create Date: 2024-04-12 13:54:12.213839 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '713caec2649e' | ||
down_revision: Union[str, None] = None | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### |
43 changes: 43 additions & 0 deletions
43
alembic/versions/2024_04_12_1357-4ae5c037da0f_add_page_data_table.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,43 @@ | ||
"""Add page_data table | ||
Revision ID: 4ae5c037da0f | ||
Revises: 713caec2649e | ||
Create Date: 2024-04-12 13:57:09.418241 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '4ae5c037da0f' | ||
down_revision: Union[str, None] = '713caec2649e' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('page_data', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('page_id', sa.String(), nullable=True), | ||
sa.Column('space_key', sa.String(), nullable=True), | ||
sa.Column('title', sa.String(), nullable=True), | ||
sa.Column('author', sa.String(), nullable=True), | ||
sa.Column('createdDate', sa.DateTime(), nullable=True), | ||
sa.Column('lastUpdated', sa.DateTime(), nullable=True), | ||
sa.Column('content', sa.Text(), nullable=True), | ||
sa.Column('comments', sa.Text(), nullable=True), | ||
sa.Column('last_embedded', sa.DateTime(), nullable=True), | ||
sa.Column('embed', sa.Text(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('page_data') | ||
# ### end Alembic commands ### |
38 changes: 38 additions & 0 deletions
38
alembic/versions/2024_04_12_1358-c3363bdf61fa_add_bookmarked_conversation_table.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,38 @@ | ||
"""Add bookmarked_conversation table | ||
Revision ID: c3363bdf61fa | ||
Revises: 4ae5c037da0f | ||
Create Date: 2024-04-12 13:58:12.798686 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'c3363bdf61fa' | ||
down_revision: Union[str, None] = '4ae5c037da0f' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('bookmarked_conversations', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('title', sa.Text(), nullable=True), | ||
sa.Column('body', sa.Text(), nullable=True), | ||
sa.Column('thread_id', sa.String(), nullable=True), | ||
sa.Column('bookmarked_on_slack', sa.DateTime(), nullable=True), | ||
sa.Column('posted_on_confluence', sa.DateTime(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('bookmarked_conversations') | ||
# ### end Alembic commands ### |
44 changes: 44 additions & 0 deletions
44
alembic/versions/2024_04_12_1358-ce3fb8b3d191_add_qa_interaction_table.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,44 @@ | ||
"""Add qa_interaction table | ||
Revision ID: ce3fb8b3d191 | ||
Revises: c3363bdf61fa | ||
Create Date: 2024-04-12 13:58:46.916722 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'ce3fb8b3d191' | ||
down_revision: Union[str, None] = 'c3363bdf61fa' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('qa_interactions', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('question_text', sa.Text(), nullable=True), | ||
sa.Column('thread_id', sa.String(), nullable=True), | ||
sa.Column('assistant_thread_id', sa.String(), nullable=True), | ||
sa.Column('answer_text', sa.Text(), nullable=True), | ||
sa.Column('channel_id', sa.String(), nullable=True), | ||
sa.Column('slack_user_id', sa.String(), nullable=True), | ||
sa.Column('question_timestamp', sa.DateTime(), nullable=True), | ||
sa.Column('answer_timestamp', sa.DateTime(), nullable=True), | ||
sa.Column('comments', sa.Text(), nullable=True), | ||
sa.Column('last_embedded', sa.DateTime(), nullable=True), | ||
sa.Column('embed', sa.Text(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('qa_interactions') | ||
# ### end Alembic commands ### |
38 changes: 38 additions & 0 deletions
38
alembic/versions/2024_04_12_1359-0278f7c21985_add_quiz_question_table.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,38 @@ | ||
"""Add quiz_question table | ||
Revision ID: 0278f7c21985 | ||
Revises: ce3fb8b3d191 | ||
Create Date: 2024-04-12 13:59:10.846548 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '0278f7c21985' | ||
down_revision: Union[str, None] = 'ce3fb8b3d191' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('quiz_questions', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('question_text', sa.Text(), nullable=True), | ||
sa.Column('thread_id', sa.String(), nullable=True), | ||
sa.Column('summary', sa.Text(), nullable=True), | ||
sa.Column('posted_on_slack', sa.DateTime(), nullable=True), | ||
sa.Column('posted_on_confluence', sa.DateTime(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('quiz_questions') | ||
# ### end Alembic commands ### |
36 changes: 36 additions & 0 deletions
36
alembic/versions/2024_04_12_1359-dccb3577feb5_add_space_info_table.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 space_info table | ||
Revision ID: dccb3577feb5 | ||
Revises: 0278f7c21985 | ||
Create Date: 2024-04-12 13:59:35.003367 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'dccb3577feb5' | ||
down_revision: Union[str, None] = '0278f7c21985' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('space_info', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('space_key', sa.String(), nullable=False), | ||
sa.Column('space_name', sa.String(), nullable=False), | ||
sa.Column('last_import_date', sa.DateTime(), nullable=False), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('space_info') | ||
# ### end Alembic commands ### |
Oops, something went wrong.