-
Notifications
You must be signed in to change notification settings - Fork 3
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 #5091 from bcgov/dev
Syncing up latest changes from dev to dev-marshal
- Loading branch information
Showing
13 changed files
with
356 additions
and
38 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
35 changes: 35 additions & 0 deletions
35
request-management-api/migrations/versions/d42a1cf67c5c_.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,35 @@ | ||
"""empty message | ||
Revision ID: d42a1cf67c5c | ||
Revises: b4da31675bd0 | ||
Create Date: 2024-02-08 12:40:33.968711 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd42a1cf67c5c' | ||
down_revision = 'b4da31675bd0' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('UnopenedReport', | ||
sa.Column('id', sa.Integer(), primary_key=True, autoincrement=True, nullable=False), | ||
sa.Column('rawrequestid', sa.Integer(), nullable=False), | ||
sa.Column('date', sa.DateTime(), nullable=True), | ||
sa.Column('rank', sa.Integer(), nullable=False), | ||
sa.Column('potentialmatches', postgresql.JSON(astext_type=sa.Text()), nullable=True) | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute('DROP TABLE IF EXISTS public."UnopenedReport";') | ||
|
||
# ### 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
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
22 changes: 22 additions & 0 deletions
22
request-management-api/request_api/models/UnopenedReport.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,22 @@ | ||
from .db import db, ma | ||
from .default_method_result import DefaultMethodResult | ||
from sqlalchemy.orm import relationship,backref | ||
from datetime import datetime | ||
from sqlalchemy import text | ||
from sqlalchemy.dialects.postgresql import JSON | ||
import json | ||
|
||
class UnopenedReport(db.Model): | ||
__tablename__ = 'UnopenedReport' | ||
# Defining the columns | ||
id = db.Column(db.Integer, primary_key=True,autoincrement=True) | ||
rawrequestid = db.Column(db.Text, unique=False, nullable=False) | ||
date = db.Column(db.Text, unique=False, nullable=False) | ||
rank = db.Column(db.Text, unique=False, nullable=False) | ||
potentialmatches = db.Column(JSON, unique=False, nullable=False) | ||
|
||
@classmethod | ||
def insert(cls, row): | ||
db.session.add(row) | ||
db.session.commit() | ||
return DefaultMethodResult(True,'Report Row added',row.rawrequestid) |
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.