-
Notifications
You must be signed in to change notification settings - Fork 9
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 #178 from introlab/dev
Main merge for 1.1.2 release
- Loading branch information
Showing
47 changed files
with
4,314 additions
and
130 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
76 changes: 76 additions & 0 deletions
76
teraserver/python/alembic/versions/dbe0ef5395eb_revised_test_types_tables.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,76 @@ | ||
"""revised test types tables | ||
Revision ID: dbe0ef5395eb | ||
Revises: c903e55a7a4f | ||
Create Date: 2022-03-28 15:01:21.497534 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.schema import CreateSequence, DropSequence | ||
from sqlalchemy.engine.reflection import Inspector | ||
import time | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'dbe0ef5395eb' | ||
down_revision = 'c903e55a7a4f' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) | ||
tables = inspector.get_table_names() | ||
|
||
if 't_tests_types_projects' in tables: | ||
op.drop_table('t_tests_types_projects') | ||
|
||
if 't_tests' in tables: | ||
op.drop_table('t_tests') | ||
|
||
if 't_tests_types' in tables: | ||
op.drop_table('t_tests_types') | ||
|
||
op.execute(DropSequence(sa.Sequence('id_test_type_sequence'))) | ||
|
||
op.create_table('t_tests_types', | ||
sa.Column('version_id', sa.BigInteger, nullable=False, default=time.time() * 1000), | ||
sa.Column('id_test_type', sa.Integer, sa.Sequence('id_test_type_sequence'), | ||
primary_key=True, autoincrement=True), | ||
sa.Column('id_service', sa.Integer, sa.ForeignKey('t_services.id_service', ondelete='cascade'), | ||
nullable=False), | ||
sa.Column('test_type_uuid', sa.String(36), nullable=False, unique=True), | ||
sa.Column('test_type_name', sa.String, nullable=False, unique=False), | ||
sa.Column('test_type_description', sa.String, nullable=True), | ||
sa.Column('test_type_has_json_format', sa.Boolean, nullable=False, default=False), | ||
sa.Column('test_type_has_web_format', sa.Boolean, nullable=False, default=False), | ||
sa.Column('test_type_has_web_editor', sa.Boolean, nullable=False, default=False) | ||
) | ||
op.execute(CreateSequence(sa.Sequence('id_test_type_sequence'))) | ||
|
||
op.create_table('t_tests_types_sites', | ||
sa.Column('version_id', sa.BigInteger, nullable=False, default=time.time() * 1000), | ||
sa.Column('id_test_type_site', sa.Integer, sa.Sequence('id_test_type_site_sequence'), | ||
primary_key=True, autoincrement=True), | ||
sa.Column('id_test_type', sa.Integer, sa.ForeignKey('t_tests_types.id_test_type', | ||
ondelete='cascade'), nullable=False), | ||
sa.Column('id_site', sa.Integer, sa.ForeignKey('t_sites.id_site', ondelete='cascade'), | ||
nullable=False)) | ||
op.execute(CreateSequence(sa.Sequence('id_test_type_site_sequence'))) | ||
|
||
op.create_table('t_tests_types_projects', | ||
sa.Column('version_id', sa.BigInteger, nullable=False, default=time.time() * 1000), | ||
sa.Column('id_test_type_project', sa.Integer, sa.Sequence('id_test_type_project_sequence'), | ||
primary_key=True, autoincrement=True), | ||
sa.Column('id_test_type', sa.Integer, sa.ForeignKey('t_tests_types.id_test_type', | ||
ondelete='cascade'), nullable=False), | ||
sa.Column('id_project', sa.Integer, sa.ForeignKey('t_projects.id_project', ondelete='cascade'), | ||
nullable=False)) | ||
op.execute(CreateSequence(sa.Sequence('id_test_type_project_sequence'))) | ||
|
||
|
||
def downgrade(): | ||
# No way to downgrade... | ||
pass |
55 changes: 55 additions & 0 deletions
55
teraserver/python/alembic/versions/f4b9e7081b18_revised_test_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,55 @@ | ||
"""revised test table | ||
Revision ID: f4b9e7081b18 | ||
Revises: dbe0ef5395eb | ||
Create Date: 2022-04-01 07:36:25.422384 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.schema import CreateSequence, DropSequence | ||
from sqlalchemy.engine.reflection import Inspector | ||
import time | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'f4b9e7081b18' | ||
down_revision = 'dbe0ef5395eb' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) | ||
tables = inspector.get_table_names() | ||
|
||
if 't_tests' in tables: | ||
op.drop_table('t_tests') | ||
|
||
op.execute(DropSequence(sa.Sequence('id_test_sequence'))) | ||
|
||
op.create_table('t_tests', | ||
sa.Column('version_id', sa.BigInteger, nullable=False, default=time.time() * 1000), | ||
sa.Column('id_test', sa.Integer, sa.Sequence('id_test_sequence'), primary_key=True, | ||
autoincrement=True), | ||
sa.Column('id_test_type', sa.Integer, sa.ForeignKey('t_tests_types.id_test_type'), nullable=False), | ||
sa.Column('id_session', sa.Integer, sa.ForeignKey('t_sessions.id_session', ondelete='cascade'), | ||
nullable=False), | ||
sa.Column('id_device', sa.Integer, sa.ForeignKey("t_devices.id_device"), nullable=True), | ||
sa.Column('id_participant', sa.Integer, sa.ForeignKey("t_participants.id_participant"), | ||
nullable=True), | ||
sa.Column('id_user', sa.Integer, sa.ForeignKey("t_users.id_user"), nullable=True), | ||
sa.Column('id_service', sa.Integer, sa.ForeignKey("t_services.id_service"), nullable=True), | ||
sa.Column('test_uuid', sa.String(36), nullable=False, unique=True), | ||
sa.Column('test_name', sa.String, nullable=False), | ||
sa.Column('test_datetime', sa.TIMESTAMP(timezone=True), nullable=False), | ||
sa.Column('test_status', sa.Integer, nullable=False, default=0), | ||
sa.Column('test_summary', sa.String, nullable=True) | ||
) | ||
op.execute(CreateSequence(sa.Sequence('id_test_sequence'))) | ||
|
||
op.add_column(table_name='t_tests_types', column=sa.Column('test_type_key', sa.String, nullable=True, unique=True)) | ||
|
||
|
||
def downgrade(): | ||
pass |
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 |
---|---|---|
|
@@ -38,3 +38,4 @@ websocket-client==1.2.1 | |
pytest==6.2.5 | ||
jsonschema==4.2.1 | ||
Jinja2==3.0.3 | ||
werkzeug==2.0.3 |
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.