Skip to content

Commit

Permalink
Merge pull request #78 from open-contracting/develop
Browse files Browse the repository at this point in the history
Merge to deploy
  • Loading branch information
nahu committed Jun 20, 2023
2 parents a8b4b19 + 031308c commit 7ce36af
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 50 deletions.
File renamed without changes.
7 changes: 5 additions & 2 deletions app/schema/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ class ApplicationBase(SQLModel):
lender_rejected_data: Optional[dict] = Field(
default={}, sa_column=Column(JSON), nullable=False
)
borrewed_uploaded_contracted_at: Optional[datetime] = Field(
lender_rejected_at: Optional[datetime] = Field(
sa_column=Column(DateTime(timezone=True), nullable=True)
)
borrower_uploaded_contracted_at: Optional[datetime] = Field(
sa_column=Column(DateTime(timezone=True), nullable=True)
)
completed_in_days: Optional[int] = Field(nullable=True)
Expand Down Expand Up @@ -264,7 +267,7 @@ class LenderBase(SQLModel):
email_group: str = Field(default="")
status: str = Field(default="")
type: str = Field(default="")
borrowed_type_preferences: dict = Field(
borrower_type_preferences: dict = Field(
default={}, sa_column=Column(JSON), nullable=False
)
limits_preferences: dict = Field(default={}, sa_column=Column(JSON), nullable=False)
Expand Down
4 changes: 2 additions & 2 deletions app/schema/diagram
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Table Application {
lender_approved_at timestamp [not null]
lender_approved_data json
lender_rejected_data json
borrewed_uploaded_contracted_at timestamp [not null]
borrower_uploaded_contracted_at timestamp [not null]
completed_in_days int
created_at timestamp [not null]
updated_at timestamp [not null]
Expand Down Expand Up @@ -67,7 +67,7 @@ Table Lender {
name text
status text
type text
borrowed_type_preferences json
borrower_type_preferences json
limits_preferences json
sla_days int
created_at timestamp [not null]
Expand Down
46 changes: 0 additions & 46 deletions background_processes/application_utils.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Add lender_rejected_at column to applications table
Revision ID: bfd66392691e
Revises: 2ca870aa737d
Create Date: 2023-06-19 10:25:49.276634
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "bfd66392691e"
down_revision = "2ca870aa737d"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.add_column(
"application",
sa.Column("lender_rejected_at", sa.DateTime(timezone=True), nullable=True),
)
op.alter_column(
"application",
"borrewed_uploaded_contracted_at",
new_column_name="borrower_uploaded_contracted_at",
)


def downgrade() -> None:
op.alter_column(
"application",
"borrower_uploaded_contracted_at",
new_column_name="borrowed_uploaded_contracted_at",
)
op.drop_column("application", "lender_rejected_at")
30 changes: 30 additions & 0 deletions migrations/versions/df236486f60a_rename_lender_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""rename lender field
Revision ID: df236486f60a
Revises: bfd66392691e
Create Date: 2023-06-20 13:08:37.396766
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "df236486f60a"
down_revision = "bfd66392691e"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.alter_column(
"lender",
"borrowed_type_preferences",
new_column_name="borrower_type_preferences",
)


def downgrade() -> None:
op.alter_column(
"lender",
"borrower_type_preferences",
new_column_name="borrowed_type_preferences",
)

0 comments on commit 7ce36af

Please sign in to comment.