-
Notifications
You must be signed in to change notification settings - Fork 5
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 #258 from planetarium/release/0.12.0
Release 0.12.0
- Loading branch information
Showing
16 changed files
with
1,857 additions
and
1,142 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
39 changes: 39 additions & 0 deletions
39
common/alembic/versions/f6de778b7fe3_add_avatarlevel_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,39 @@ | ||
"""Add AvatarLevel table | ||
Revision ID: f6de778b7fe3 | ||
Revises: 90ff6ac09fe5 | ||
Create Date: 2024-03-20 11:39:30.281858 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'f6de778b7fe3' | ||
down_revision = '90ff6ac09fe5' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('avatar_level', | ||
sa.Column('agent_addr', sa.Text(), nullable=False), | ||
sa.Column('avatar_addr', sa.Text(), nullable=False), | ||
sa.Column('planet_id', sa.LargeBinary(length=12), nullable=False), | ||
sa.Column('level', sa.Integer(), nullable=False), | ||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True), | ||
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.create_index('idx_avatar_planet', 'avatar_level', ['avatar_addr', 'planet_id'], unique=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index('idx_avatar_planet', table_name='avatar_level') | ||
op.drop_table('avatar_level') | ||
# ### 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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
"receipt", | ||
"product", | ||
"voucher", | ||
"user", | ||
] |
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,20 @@ | ||
from sqlalchemy import Column, Text, LargeBinary, Integer, Index | ||
|
||
from common.models.base import Base, AutoIdMixin, TimeStampMixin | ||
from common.utils.receipt import PlanetID | ||
|
||
|
||
class AvatarLevel(AutoIdMixin, TimeStampMixin, Base): | ||
""" | ||
AvatarLevel is some sort of cache table checking required level. | ||
""" | ||
__tablename__ = "avatar_level" | ||
agent_addr = Column(Text, nullable=False, doc="9c agent address where to get FAVs") | ||
avatar_addr = Column(Text, nullable=False, doc="9c avatar's address where to get items") | ||
planet_id = Column(LargeBinary(length=12), nullable=False, default=PlanetID.ODIN.value, | ||
doc="An identifier of planets") | ||
level = Column(Integer, nullable=False, doc="Cached max level of avatar") | ||
|
||
__table_args__ = ( | ||
Index("idx_avatar_planet", avatar_addr, planet_id), | ||
) |
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.