-
Notifications
You must be signed in to change notification settings - Fork 1
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
53 changed files
with
1,341 additions
and
2,082 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""dns | ||
Revision ID: 318dcd16a600 | ||
Revises: 260e33819b5e | ||
Create Date: 2024-06-17 18:13:43.120105 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '318dcd16a600' | ||
down_revision = '260e33819b5e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('unit', sa.Column('basis_of_record', sa.String(length=50), nullable=True)) | ||
op.add_column('unit', sa.Column('material_entity_id', sa.String(length=500), nullable=True)) | ||
op.add_column('unit', sa.Column('dna_sequence', sa.Text(), nullable=True)) | ||
op.add_column('unit', sa.Column('sequencer', sa.String(length=500), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('unit', 'sequencer') | ||
op.drop_column('unit', 'dna_sequence') | ||
op.drop_column('unit', 'material_entity_id') | ||
op.drop_column('unit', 'basis_of_record') | ||
# ### end Alembic commands ### |
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,29 @@ | ||
"""site-rm-code | ||
Revision ID: 3785ccd6eb37 | ||
Revises: 3da76abfc432 | ||
Create Date: 2024-06-18 05:19:48.455171 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '3785ccd6eb37' | ||
down_revision = '3da76abfc432' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('site', 'code') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('site', sa.Column('code', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
# ### end Alembic commands ### |
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,61 @@ | ||
"""site-schema | ||
Revision ID: 3da76abfc432 | ||
Revises: 4c228755cffb | ||
Create Date: 2024-06-18 05:09:31.292914 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '3da76abfc432' | ||
down_revision = '4c228755cffb' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('organization', 'domain') | ||
op.drop_column('organization', 'is_site') | ||
op.drop_column('organization', 'settings') | ||
op.drop_column('organization', 'subdomain') | ||
op.drop_column('organization', 'description') | ||
op.drop_column('organization', 'ark_nma') | ||
op.drop_column('organization', 'logo_url') | ||
op.add_column('site', sa.Column('title', sa.String(length=500), nullable=True)) | ||
op.add_column('site', sa.Column('title_en', sa.String(length=500), nullable=True)) | ||
op.add_column('site', sa.Column('logo_url', sa.String(length=500), nullable=True)) | ||
op.add_column('site', sa.Column('description', sa.Text(), nullable=True)) | ||
op.alter_column('site', 'name', | ||
existing_type=sa.VARCHAR(length=500), | ||
type_=sa.String(length=50), | ||
existing_nullable=True) | ||
op.drop_column('site', 'name_en') | ||
op.drop_column('site', 'short_name') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('site', sa.Column('short_name', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
op.add_column('site', sa.Column('name_en', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
op.alter_column('site', 'name', | ||
existing_type=sa.String(length=50), | ||
type_=sa.VARCHAR(length=500), | ||
existing_nullable=True) | ||
op.drop_column('site', 'description') | ||
op.drop_column('site', 'logo_url') | ||
op.drop_column('site', 'title_en') | ||
op.drop_column('site', 'title') | ||
op.add_column('organization', sa.Column('logo_url', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('ark_nma', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('description', sa.TEXT(), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('subdomain', sa.VARCHAR(length=100), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('settings', postgresql.JSONB(astext_type=sa.Text()), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('is_site', sa.BOOLEAN(), autoincrement=False, nullable=True)) | ||
op.add_column('organization', sa.Column('domain', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
# ### end Alembic commands ### |
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 @@ | ||
"""host | ||
Revision ID: 4c228755cffb | ||
Revises: aef30cda76fc | ||
Create Date: 2024-06-18 02:51:58.696708 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '4c228755cffb' | ||
down_revision = 'aef30cda76fc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('site', sa.Column('host', sa.String(length=500), nullable=True)) | ||
op.drop_column('site', 'domain') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('site', sa.Column('domain', sa.VARCHAR(length=500), autoincrement=False, nullable=True)) | ||
op.drop_column('site', 'host') | ||
# ### end Alembic commands ### |
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 @@ | ||
"""collection-site-id | ||
Revision ID: 54844ef10da8 | ||
Revises: c80f91a5fba6 | ||
Create Date: 2024-06-19 10:11:44.863294 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '54844ef10da8' | ||
down_revision = 'c80f91a5fba6' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('collection', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.create_foreign_key(None, 'collection', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'collection', type_='foreignkey') | ||
op.drop_column('collection', 'site_id') | ||
# ### end Alembic commands ### |
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,67 @@ | ||
"""site_id | ||
Revision ID: aef30cda76fc | ||
Revises: b5a42e695eb4 | ||
Create Date: 2024-06-18 02:48:05.528842 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'aef30cda76fc' | ||
down_revision = 'b5a42e695eb4' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('article', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.drop_constraint('article_organization_id_fkey', 'article', type_='foreignkey') | ||
op.create_foreign_key(None, 'article', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('article', 'organization_id') | ||
op.add_column('article_category', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.drop_constraint('article_category_organization_id_fkey', 'article_category', type_='foreignkey') | ||
op.create_foreign_key(None, 'article_category', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('article_category', 'organization_id') | ||
op.add_column('related_link', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.drop_constraint('related_link_organization_id_fkey', 'related_link', type_='foreignkey') | ||
op.create_foreign_key(None, 'related_link', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('related_link', 'organization_id') | ||
op.add_column('related_link_category', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.drop_constraint('related_link_category_organization_id_fkey', 'related_link_category', type_='foreignkey') | ||
op.create_foreign_key(None, 'related_link_category', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('related_link_category', 'organization_id') | ||
op.add_column('user', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.drop_constraint('user_organization_id_fkey', 'user', type_='foreignkey') | ||
op.create_foreign_key(None, 'user', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('user', 'organization_id') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('user', sa.Column('organization_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(None, 'user', type_='foreignkey') | ||
op.create_foreign_key('user_organization_id_fkey', 'user', 'organization', ['organization_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('user', 'site_id') | ||
op.add_column('related_link_category', sa.Column('organization_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(None, 'related_link_category', type_='foreignkey') | ||
op.create_foreign_key('related_link_category_organization_id_fkey', 'related_link_category', 'organization', ['organization_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('related_link_category', 'site_id') | ||
op.add_column('related_link', sa.Column('organization_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(None, 'related_link', type_='foreignkey') | ||
op.create_foreign_key('related_link_organization_id_fkey', 'related_link', 'organization', ['organization_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('related_link', 'site_id') | ||
op.add_column('article_category', sa.Column('organization_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(None, 'article_category', type_='foreignkey') | ||
op.create_foreign_key('article_category_organization_id_fkey', 'article_category', 'organization', ['organization_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('article_category', 'site_id') | ||
op.add_column('article', sa.Column('organization_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(None, 'article', type_='foreignkey') | ||
op.create_foreign_key('article_organization_id_fkey', 'article', 'organization', ['organization_id'], ['id'], ondelete='SET NULL') | ||
op.drop_column('article', 'site_id') | ||
# ### end Alembic commands ### |
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,41 @@ | ||
"""site-dep | ||
Revision ID: b5a42e695eb4 | ||
Revises: 318dcd16a600 | ||
Create Date: 2024-06-18 02:38:08.714498 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'b5a42e695eb4' | ||
down_revision = '318dcd16a600' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('site', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('name', sa.String(length=500), nullable=True), | ||
sa.Column('name_en', sa.String(length=500), nullable=True), | ||
sa.Column('short_name', sa.String(length=500), nullable=True), | ||
sa.Column('code', sa.String(length=500), nullable=True), | ||
sa.Column('domain', sa.String(length=500), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.add_column('organization', sa.Column('site_id', sa.Integer(), nullable=True)) | ||
op.create_foreign_key(None, 'organization', 'site', ['site_id'], ['id'], ondelete='SET NULL') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'organization', type_='foreignkey') | ||
op.drop_column('organization', 'site_id') | ||
op.drop_table('site') | ||
# ### end Alembic commands ### |
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,29 @@ | ||
"""site.data | ||
Revision ID: c80f91a5fba6 | ||
Revises: 3785ccd6eb37 | ||
Create Date: 2024-06-18 08:42:35.128037 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'c80f91a5fba6' | ||
down_revision = '3785ccd6eb37' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('site', sa.Column('data', postgresql.JSONB(astext_type=sa.Text()), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('site', 'data') | ||
# ### end Alembic commands ### |
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.