Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion collectoss/application/db/models/augur_operations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
from sqlalchemy import BigInteger, SmallInteger, Column, Index, Integer, String, Table, text, UniqueConstraint, Boolean, ForeignKey, update, CheckConstraint, Sequence
from sqlalchemy import BigInteger, SmallInteger, Column, Index, Integer, String, Table, text, UniqueConstraint, Boolean, ForeignKey, update, CheckConstraint, Sequence, DateTime, func
from sqlalchemy.dialects.postgresql import TIMESTAMP
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from sqlalchemy.exc import IntegrityError
Expand Down Expand Up @@ -1072,6 +1072,20 @@
session.rollback()
raise e

class ForgeInstance(Base):
__tablename__ = "forge_instance"
__table_args__ = { "schema": "augur_operations" }

id = Column(Integer, primary_key=True, nullable=False, comment="Internal unique identifier for this forge instance")
# platform_type stores an integer that CollectOSS maps/will map to it's internal platform
# identifer Enum (as used in ContributorUUID) for identifying the API endpoints and tasks to use for collection

Check failure on line 1081 in collectoss/application/db/models/augur_operations.py

View workflow job for this annotation

GitHub Actions / misspell

[misspell] collectoss/application/db/models/augur_operations.py#L1081

"identifer" is a misspelling of "identifier"
Raw output
./collectoss/application/db/models/augur_operations.py:1081:6: "identifer" is a misspelling of "identifier"
platform_type = Column(Integer, nullable=False, comment="Type specifier identifying the relevant platform API interface to CollectOSS")
name = Column(String, nullable=False, comment="User-specified name for this forge instance")
# https://stackoverflow.com/a/54800233
date_added = Column(DateTime(timezone=True), nullable=False, default=func.now())
domain_name = Column(String, nullable=False, comment="The base domain name (without the scheme) where this instance is hosted")
enabled = Column(Boolean, default=True, nullable=False, comment="denotes whether collection should run for this instance")


class Subscription(Base):
__tablename__ = "subscriptions"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""introduce empty instances table

Revision ID: 42
Revises: 41
Create Date: 2026-05-07 15:51:17.510641

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '42'
down_revision = '41'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('forge_instance',
sa.Column('id', sa.Integer(), nullable=False, comment='Internal unique identifier for this forge instance'),
sa.Column('platform_type', sa.Integer(), nullable=False, comment='Type specifier identifying the relevant platform API interface to CollectOSS'),
sa.Column('name', sa.String(), nullable=False, comment='User-specified name for this forge instance'),
sa.Column('date_added', sa.DateTime(timezone=True), nullable=False),
sa.Column('domain_name', sa.String(), nullable=False, comment='The base domain name (without the scheme) where this instance is hosted'),
sa.Column('enabled', sa.Boolean(), nullable=False, comment='denotes whether collection should run for this instance'),
sa.PrimaryKeyConstraint('id'),
schema='augur_operations'
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('forge_instance', schema='augur_operations')
# ### end Alembic commands ###
Loading