Fix reports

Add currency report
make reports use json storage
Make tables nicer
This commit is contained in:
Aaron Kimbre
2022-01-16 20:24:47 -06:00
parent 1a5531eb19
commit b2af6d967a
17 changed files with 197 additions and 67 deletions

View File

@@ -1,8 +1,8 @@
"""items-reports
"""reports
Revision ID: 3da561e7f7c0
Revision ID: aee4c6c24811
Revises: 8a2966b9f7ee
Create Date: 2022-01-16 18:27:11.067205
Create Date: 2022-01-16 20:12:39.816567
"""
from alembic import op
@@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3da561e7f7c0'
revision = 'aee4c6c24811'
down_revision = '8a2966b9f7ee'
branch_labels = None
depends_on = None
@@ -18,15 +18,16 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('item_reports',
op.create_table('reports',
sa.Column('data', sa.JSON(), nullable=False),
sa.Column('report_type', sa.VARCHAR(length=35), autoincrement=False, nullable=False),
sa.Column('date', sa.Date(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('date')
sa.PrimaryKeyConstraint('report_type', 'date')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('item_reports')
op.drop_table('reports')
# ### end Alembic commands ###