-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1045 from debrief/develop
New release
- Loading branch information
Showing
62 changed files
with
1,363 additions
and
326 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"LATEST_POSTGRES_VERSION": "c16bbfed85dc", | ||
"LATEST_SQLITE_VERSION": "a7f75ead6204" | ||
"LATEST_SQLITE_VERSION": "feb548c7c6c0", | ||
"LATEST_POSTGRES_VERSION": "4899e94653f1" | ||
} |
89 changes: 89 additions & 0 deletions
89
migrations/postgres_versions/2021-09-24_4899e94653f1_alter_extractions_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,89 @@ | ||
"""Alter Extractions table | ||
Revision ID: 4899e94653f1 | ||
Revises: bfb29dfcef94 | ||
Create Date: 2021-09-24 12:40:23.320197+00:00 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "4899e94653f1" | ||
down_revision = "c16bbfed85dc" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("destination_table", sa.String(length=150), nullable=True), | ||
schema="pepys", | ||
) | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("entry_id", postgresql.UUID(as_uuid=True), nullable=True), | ||
schema="pepys", | ||
) | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("datafile_id", postgresql.UUID(as_uuid=True), nullable=False), | ||
schema="pepys", | ||
) | ||
op.add_column("Extractions", sa.Column("text", sa.Text(), nullable=False), schema="pepys") | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("text_location", sa.String(length=200), nullable=False), | ||
schema="pepys", | ||
) | ||
op.add_column( | ||
"Extractions", sa.Column("importer", sa.String(length=150), nullable=False), schema="pepys" | ||
) | ||
op.add_column( | ||
"Extractions", sa.Column("interpreted_value", sa.Text(), nullable=False), schema="pepys" | ||
) | ||
op.create_foreign_key( | ||
op.f("fk_Extractions_datafile_id_Datafiles"), | ||
"Extractions", | ||
"Datafiles", | ||
["datafile_id"], | ||
["datafile_id"], | ||
source_schema="pepys", | ||
referent_schema="pepys", | ||
onupdate="cascade", | ||
ondelete="cascade", | ||
) | ||
op.drop_column("Extractions", "chars", schema="pepys") | ||
op.drop_column("Extractions", "table", schema="pepys") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("table", sa.VARCHAR(length=150), autoincrement=False, nullable=False), | ||
schema="pepys", | ||
) | ||
op.add_column( | ||
"Extractions", | ||
sa.Column("chars", sa.VARCHAR(length=150), autoincrement=False, nullable=False), | ||
schema="pepys", | ||
) | ||
op.drop_constraint( | ||
op.f("fk_Extractions_datafile_id_Datafiles"), | ||
"Extractions", | ||
schema="pepys", | ||
type_="foreignkey", | ||
) | ||
op.drop_column("Extractions", "interpreted_value", schema="pepys") | ||
op.drop_column("Extractions", "importer", schema="pepys") | ||
op.drop_column("Extractions", "text_location", schema="pepys") | ||
op.drop_column("Extractions", "text", schema="pepys") | ||
op.drop_column("Extractions", "datafile_id", schema="pepys") | ||
op.drop_column("Extractions", "entry_id", schema="pepys") | ||
op.drop_column("Extractions", "destination_table", schema="pepys") | ||
# ### end Alembic commands ### |
70 changes: 70 additions & 0 deletions
70
migrations/sqlite_versions/2021-09-20_feb548c7c6c0_alter_extractions_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,70 @@ | ||
"""Alter Extractions table | ||
Revision ID: feb548c7c6c0 | ||
Revises: a7f75ead6204 | ||
Create Date: 2021-09-20 12:38:20.179908+00:00 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
import pepys_import | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "feb548c7c6c0" | ||
down_revision = "a7f75ead6204" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("Extractions", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("destination_table", sa.String(length=150), nullable=True)) | ||
batch_op.add_column( | ||
sa.Column( | ||
"entry_id", pepys_import.utils.sqlalchemy_utils.UUIDType(length=16), nullable=True | ||
) | ||
) | ||
batch_op.add_column( | ||
sa.Column( | ||
"datafile_id", | ||
pepys_import.utils.sqlalchemy_utils.UUIDType(length=16), | ||
nullable=False, | ||
) | ||
) | ||
batch_op.add_column(sa.Column("text", sa.Text(), nullable=False)) | ||
batch_op.add_column(sa.Column("text_location", sa.String(length=200), nullable=False)) | ||
batch_op.add_column(sa.Column("importer", sa.String(length=150), nullable=False)) | ||
batch_op.add_column(sa.Column("interpreted_value", sa.Text(), nullable=False)) | ||
batch_op.create_foreign_key( | ||
batch_op.f("fk_Extractions_datafile_id_Datafiles"), | ||
"Datafiles", | ||
["datafile_id"], | ||
["datafile_id"], | ||
onupdate="cascade", | ||
ondelete="cascade", | ||
) | ||
batch_op.drop_column("table") | ||
batch_op.drop_column("chars") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("Extractions", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("chars", sa.VARCHAR(length=150), nullable=False)) | ||
batch_op.add_column(sa.Column("table", sa.VARCHAR(length=150), nullable=False)) | ||
batch_op.drop_constraint( | ||
batch_op.f("fk_Extractions_datafile_id_Datafiles"), type_="foreignkey" | ||
) | ||
batch_op.drop_column("interpreted_value") | ||
batch_op.drop_column("importer") | ||
batch_op.drop_column("text_location") | ||
batch_op.drop_column("text") | ||
batch_op.drop_column("datafile_id") | ||
batch_op.drop_column("entry_id") | ||
batch_op.drop_column("destination_table") | ||
|
||
# ### end Alembic commands ### |
Oops, something went wrong.