571 lines
26 KiB
Python
571 lines
26 KiB
Python
"""Initial Commit
|
|
|
|
Revision ID: 8c06ac60d125
|
|
Revises:
|
|
Create Date: 2020-06-04 08:14:34.132248
|
|
|
|
"""
|
|
import uuid
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
from barker.models import Section, ModifierCategory, SettleOption, Customer, DbSetting
|
|
from barker.models.auth import User, Permission # noqa
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "8c06ac60d125"
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"clients",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("enabled", sa.Boolean(), nullable=False),
|
|
sa.Column("otp", sa.Integer(), nullable=True),
|
|
sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_clients")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_clients_name")),
|
|
)
|
|
op.create_table(
|
|
"customers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("company", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("phone", sa.Unicode(length=255), nullable=True),
|
|
sa.Column("address", sa.Unicode(length=255), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_customers")),
|
|
sa.UniqueConstraint("phone", name=op.f("uq_customers_phone")),
|
|
)
|
|
op.create_table(
|
|
"menu_categories",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("discount_limit", sa.Numeric(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("is_fixture", sa.Boolean(), nullable=False),
|
|
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_menu_categories")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_menu_categories_name")),
|
|
)
|
|
op.create_table(
|
|
"modifier_categories",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("minimum", sa.Integer(), nullable=False),
|
|
sa.Column("maximum", sa.Integer(), nullable=True),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_modifier_categories")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_modifier_categories_name")),
|
|
)
|
|
op.create_table(
|
|
"permissions",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=True),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_permissions")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_permissions_name")),
|
|
)
|
|
op.create_table(
|
|
"printers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("address", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("cut_code", sa.Unicode(length=255), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_printers")),
|
|
sa.UniqueConstraint("address", name=op.f("uq_printers_address")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_printers_name")),
|
|
)
|
|
op.create_table(
|
|
"roles",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=True),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_roles")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_roles_name")),
|
|
)
|
|
op.create_table(
|
|
"sections",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_sections")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_sections_name")),
|
|
)
|
|
op.create_table(
|
|
"settings",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("data", sa.JSON(), nullable=True),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_settings")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_settings_name")),
|
|
)
|
|
op.create_table(
|
|
"settle_options",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("show_in_choices", sa.Boolean(), nullable=False),
|
|
sa.Column("display_group", sa.Integer(), nullable=False),
|
|
sa.Column("is_print", sa.Boolean(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_settle_options")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_settle_options_name")),
|
|
)
|
|
op.create_table(
|
|
"taxes",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("rate", sa.Numeric(), nullable=False),
|
|
sa.Column("is_fixture", sa.Boolean(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_taxes")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_taxes_name")),
|
|
)
|
|
op.create_table(
|
|
"users",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("password", sa.Unicode(length=60), nullable=False),
|
|
sa.Column("locked_out", sa.Boolean(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_users")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_users_name")),
|
|
)
|
|
op.create_table(
|
|
"devices",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["section_id"], ["sections.id"], name=op.f("fk_devices_section_id_sections")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_devices")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_devices_name")),
|
|
)
|
|
op.create_table(
|
|
"food_tables",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("seats", sa.Numeric(), nullable=False),
|
|
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(["section_id"], ["sections.id"], name=op.f("fk_food_tables_section_id_sections")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_food_tables")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_food_tables_name")),
|
|
)
|
|
op.create_table(
|
|
"guest_book",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("customer_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("pax", sa.Numeric(), nullable=False),
|
|
sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False),
|
|
sa.ForeignKeyConstraint(["customer_id"], ["customers.id"], name=op.f("fk_guest_book_customer_id_customers")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_guest_book")),
|
|
)
|
|
op.create_table(
|
|
"modifiers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("show_in_bill", sa.Boolean(), nullable=False),
|
|
sa.Column("price", sa.Numeric(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("modifier_category_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["modifier_category_id"],
|
|
["modifier_categories.id"],
|
|
name=op.f("fk_modifiers_modifier_category_id_modifier_categories"),
|
|
),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_modifiers")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_modifiers_name")),
|
|
)
|
|
op.create_table(
|
|
"role_permissions",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("permission_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("role_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["permission_id"], ["permissions.id"], name=op.f("fk_role_permissions_permission_id_permissions")
|
|
),
|
|
sa.ForeignKeyConstraint(["role_id"], ["roles.id"], name=op.f("fk_role_permissions_role_id_roles")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_role_permissions")),
|
|
sa.UniqueConstraint("permission_id", "role_id", name=op.f("uq_role_permissions_permission_id")),
|
|
)
|
|
op.create_table(
|
|
"sale_categories",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("tax_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["tax_id"], ["taxes.id"], name=op.f("fk_sale_categories_tax_id_taxes")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_sale_categories")),
|
|
sa.UniqueConstraint("name", name=op.f("uq_sale_categories_name")),
|
|
)
|
|
op.create_table(
|
|
"section_printers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("menu_category_id", postgresql.UUID(), nullable=True),
|
|
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("printer_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("copies", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["menu_category_id"],
|
|
["menu_categories.id"],
|
|
name=op.f("fk_section_printers_menu_category_id_menu_categories"),
|
|
),
|
|
sa.ForeignKeyConstraint(["printer_id"], ["printers.id"], name=op.f("fk_section_printers_printer_id_printers")),
|
|
sa.ForeignKeyConstraint(["section_id"], ["sections.id"], name=op.f("fk_section_printers_section_id_sections")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_section_printers")),
|
|
sa.UniqueConstraint("menu_category_id", "section_id", name=op.f("uq_section_printers_menu_category_id")),
|
|
)
|
|
op.create_table(
|
|
"user_roles",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("user_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("role_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["role_id"], ["roles.id"], name=op.f("fk_user_roles_role_id_roles")),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_user_roles_user_id_users")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_user_roles")),
|
|
sa.UniqueConstraint("user_id", "role_id", name=op.f("uq_user_roles_user_id")),
|
|
)
|
|
op.create_table(
|
|
"products",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("units", sa.Unicode(length=255), nullable=False),
|
|
sa.Column("menu_category_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("sale_category_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("price", sa.Numeric(), nullable=False),
|
|
sa.Column("has_happy_hour", sa.Boolean(), nullable=False),
|
|
sa.Column("is_not_available", sa.Boolean(), nullable=False),
|
|
sa.Column("quantity", sa.Numeric(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["menu_category_id"], ["menu_categories.id"], name=op.f("fk_products_menu_category_id_menu_categories")
|
|
),
|
|
sa.ForeignKeyConstraint(
|
|
["sale_category_id"], ["sale_categories.id"], name=op.f("fk_products_sale_category_id_sale_categories")
|
|
),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_products")),
|
|
sa.UniqueConstraint("name", "units", name=op.f("uq_products_name")),
|
|
)
|
|
op.create_table(
|
|
"vouchers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("date", sa.DateTime(), nullable=False),
|
|
sa.Column("pax", sa.Numeric(), nullable=False),
|
|
sa.Column("bill_id", sa.Numeric(), nullable=True),
|
|
sa.Column("kot_id", sa.Numeric(), nullable=False),
|
|
sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("last_edit_date", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("food_table_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("customer_id", postgresql.UUID(), nullable=True),
|
|
sa.Column("narration", sa.Unicode(length=1000), nullable=False),
|
|
sa.Column("reason", sa.Unicode(length=255), nullable=True),
|
|
sa.Column("voucher_type", sa.Integer(), nullable=False),
|
|
sa.Column("user_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["customer_id"], ["customers.id"], name=op.f("fk_vouchers_customer_id_customers")),
|
|
sa.ForeignKeyConstraint(
|
|
["food_table_id"], ["food_tables.id"], name=op.f("fk_vouchers_food_table_id_food_tables")
|
|
),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_vouchers_user_id_users")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_vouchers")),
|
|
sa.UniqueConstraint("bill_id", "voucher_type", name=op.f("uq_vouchers_bill_id")),
|
|
sa.UniqueConstraint("kot_id", name=op.f("uq_vouchers_kot_id")),
|
|
)
|
|
op.create_index(op.f("ix_vouchers_date"), "vouchers", ["date"], unique=False)
|
|
op.create_table(
|
|
"kots",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("voucher_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("code", sa.Numeric(), nullable=False),
|
|
sa.Column("food_table_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("date", sa.DateTime(), nullable=False),
|
|
sa.Column("user_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["food_table_id"], ["food_tables.id"], name=op.f("fk_kots_food_table_id_food_tables")),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_kots_user_id_users")),
|
|
sa.ForeignKeyConstraint(["voucher_id"], ["vouchers.id"], name=op.f("fk_kots_voucher_id_vouchers")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_kots")),
|
|
sa.UniqueConstraint("code", name=op.f("uq_kots_code")),
|
|
)
|
|
op.create_index(op.f("ix_kots_date"), "kots", ["date"], unique=False)
|
|
op.create_index(op.f("ix_kots_voucher_id"), "kots", ["voucher_id"], unique=False)
|
|
op.create_table(
|
|
"modifier_categories_products",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("product_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("modifier_categories_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["modifier_categories_id"],
|
|
["modifier_categories.id"],
|
|
name=op.f("fk_modifier_categories_products_modifier_categories_id_modifier_categories"),
|
|
),
|
|
sa.ForeignKeyConstraint(
|
|
["product_id"], ["products.id"], name=op.f("fk_modifier_categories_products_product_id_products")
|
|
),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_modifier_categories_products")),
|
|
sa.UniqueConstraint(
|
|
"product_id", "modifier_categories_id", name=op.f("uq_modifier_categories_products_product_id")
|
|
),
|
|
)
|
|
op.create_table(
|
|
"overview",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("voucher_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("food_table_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("guest_book_id", postgresql.UUID(), nullable=True),
|
|
sa.Column("status", sa.Unicode(length=255), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["food_table_id"], ["food_tables.id"], name=op.f("fk_overview_food_table_id_food_tables")
|
|
),
|
|
sa.ForeignKeyConstraint(
|
|
["guest_book_id"], ["guest_book.id"], name=op.f("fk_overview_guest_book_id_guest_book")
|
|
),
|
|
sa.ForeignKeyConstraint(["voucher_id"], ["vouchers.id"], name=op.f("fk_overview_voucher_id_vouchers")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_overview")),
|
|
sa.UniqueConstraint("food_table_id", name=op.f("uq_overview_food_table_id")),
|
|
sa.UniqueConstraint("guest_book_id", name=op.f("uq_overview_guest_book_id")),
|
|
sa.UniqueConstraint("voucher_id", name=op.f("uq_overview_voucher_id")),
|
|
)
|
|
op.create_table(
|
|
"reprints",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("date", sa.DateTime(), nullable=False),
|
|
sa.Column("voucher_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("user_id", postgresql.UUID(), nullable=False),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_reprints_user_id_users")),
|
|
sa.ForeignKeyConstraint(["voucher_id"], ["vouchers.id"], name=op.f("fk_reprints_voucher_id_vouchers")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_reprints")),
|
|
)
|
|
op.create_index(op.f("ix_reprints_date"), "reprints", ["date"], unique=False)
|
|
op.create_index(op.f("ix_reprints_voucher_id"), "reprints", ["voucher_id"], unique=False)
|
|
op.create_table(
|
|
"settlements",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("voucher_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("settled", sa.Integer(), nullable=False),
|
|
sa.Column("amount", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(["settled"], ["settle_options.id"], name=op.f("fk_settlements_settled_settle_options")),
|
|
sa.ForeignKeyConstraint(["voucher_id"], ["vouchers.id"], name=op.f("fk_settlements_voucher_id_vouchers")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_settlements")),
|
|
sa.UniqueConstraint("voucher_id", "settled", name=op.f("uq_settlements_voucher_id")),
|
|
)
|
|
op.create_index(op.f("ix_settlements_voucher_id"), "settlements", ["voucher_id"], unique=False)
|
|
op.create_table(
|
|
"inventories",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("kot_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("product_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("quantity", sa.Numeric(), nullable=True),
|
|
sa.Column("price", sa.Numeric(), nullable=True),
|
|
sa.Column("is_happy_hour", sa.Boolean(), nullable=False),
|
|
sa.Column("tax_rate", sa.Numeric(), nullable=True),
|
|
sa.Column("tax_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("discount", sa.Numeric(), nullable=True),
|
|
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(["kot_id"], ["kots.id"], name=op.f("fk_inventories_kot_id_kots")),
|
|
sa.ForeignKeyConstraint(["product_id"], ["products.id"], name=op.f("fk_inventories_product_id_products")),
|
|
sa.ForeignKeyConstraint(["tax_id"], ["taxes.id"], name=op.f("fk_inventories_tax_id_taxes")),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_inventories")),
|
|
sa.UniqueConstraint("kot_id", "product_id", "is_happy_hour", "price", name=op.f("uq_inventories_kot_id")),
|
|
)
|
|
op.create_index(op.f("ix_inventories_kot_id"), "inventories", ["kot_id"], unique=False)
|
|
op.create_table(
|
|
"inventory_modifiers",
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
sa.Column("inventory_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("modifier_id", postgresql.UUID(), nullable=False),
|
|
sa.Column("price", sa.Numeric(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["inventory_id"], ["inventories.id"], name=op.f("fk_inventory_modifiers_inventory_id_inventories")
|
|
),
|
|
sa.ForeignKeyConstraint(
|
|
["modifier_id"], ["modifiers.id"], name=op.f("fk_inventory_modifiers_modifier_id_modifiers")
|
|
),
|
|
sa.PrimaryKeyConstraint("id", name=op.f("pk_inventory_modifiers")),
|
|
sa.UniqueConstraint("inventory_id", "modifier_id", name=op.f("uq_inventory_modifiers_inventory_id")),
|
|
)
|
|
|
|
op.execute(Permission.__table__.insert().values(id="7669dfc9-cc75-4e48-b267-145c8832a83c", name="Guest Book"))
|
|
op.execute(Permission.__table__.insert().values(id="5b66c6f6-003a-4ef8-ba28-49b8ff1ac33c", name="Printers"))
|
|
op.execute(Permission.__table__.insert().values(id="c973f32c-a37b-496a-8dc5-60d2e4c39e97", name="Sections"))
|
|
op.execute(Permission.__table__.insert().values(id="7a04ba63-5d08-4078-9051-a6d91cce3e48", name="Section Printers"))
|
|
op.execute(Section.__table__.insert().values(id="3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df", name="Main"))
|
|
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="e046ad33-dc65-4c78-8833-c3d3538d44c0",
|
|
name="Old Modifiers",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="b572f401-3c2f-48b9-8973-ada5a6e4d3a6",
|
|
name="Bar Instructions",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="caa72832-5034-405e-8442-68a8cc12ace9",
|
|
name="Delivery",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="d6a0595f-e209-42e4-bb12-b7499f9a9c4d",
|
|
name="Kitchen Instructions",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="60ca9122-adc5-463b-ad5f-33a68df8c3ae",
|
|
name="Mixers",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
op.execute(
|
|
ModifierCategory.__table__.insert().values(
|
|
id="ef5b1a0b-5eb1-45ff-bd82-3209c8b888df",
|
|
name="Pasta Sauce",
|
|
maximum=None,
|
|
minimum=0,
|
|
is_active=True,
|
|
sort_order=0,
|
|
)
|
|
)
|
|
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=1, name="Unsettled", show_in_choices=False, display_group=1, is_print=True
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(id=2, name="Cash", show_in_choices=True, display_group=2, is_print=False)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=3, name="Credit Card", show_in_choices=True, display_group=2, is_print=True
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=4, name="No Charge", show_in_choices=True, display_group=3, is_print=True
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=5, name="Bill To Company", show_in_choices=True, display_group=2, is_print=True
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(id=6, name="Tip", show_in_choices=True, display_group=2, is_print=True)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=7, name="Round Off", show_in_choices=False, display_group=1, is_print=False
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=8, name="Amount", show_in_choices=False, display_group=1, is_print=False
|
|
)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(id=9, name="Void", show_in_choices=True, display_group=1, is_print=True)
|
|
)
|
|
op.execute(
|
|
SettleOption.__table__.insert().values(
|
|
id=10, name="Staff", show_in_choices=True, display_group=4, is_print=True
|
|
)
|
|
)
|
|
op.execute(
|
|
Customer.__table__.insert().values(
|
|
id="2c716f4b-0736-429a-ad51-610d7c47cb5e", company="", name="Cash", phone="", address=""
|
|
)
|
|
)
|
|
op.execute(
|
|
DbSetting.__table__.insert().values(
|
|
id="fb738ba2-a3c9-40ed-891c-b930e6454974",
|
|
name="Header",
|
|
data={
|
|
"Text": """ Hops n Grains
|
|
The Microbrewery
|
|
SCO 358, Sector 9, Panchkula
|
|
A Unit of Peitho Foods Pvt. Ltd.
|
|
CIN: U15139CH2010PTC032202
|
|
(Reg Add: Plot No. 907, Indl Area II, Chd)
|
|
TIN: 06592507323
|
|
Service Tax: AAFCP5097GSD001
|
|
"""
|
|
},
|
|
)
|
|
)
|
|
op.execute(
|
|
DbSetting.__table__.insert().values(
|
|
id="f7799871-d16e-4c4d-9b57-2299a5839acb",
|
|
name="Footer",
|
|
data={"Text": "Call: 0172-4026666, 8054923853, 8054923856"},
|
|
)
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table("inventory_modifiers")
|
|
op.drop_index(op.f("ix_inventories_kot_id"), table_name="inventories")
|
|
op.drop_table("inventories")
|
|
op.drop_index(op.f("ix_settlements_voucher_id"), table_name="settlements")
|
|
op.drop_table("settlements")
|
|
op.drop_index(op.f("ix_reprints_voucher_id"), table_name="reprints")
|
|
op.drop_index(op.f("ix_reprints_date"), table_name="reprints")
|
|
op.drop_table("reprints")
|
|
op.drop_table("overview")
|
|
op.drop_table("modifier_categories_products")
|
|
op.drop_index(op.f("ix_kots_voucher_id"), table_name="kots")
|
|
op.drop_index(op.f("ix_kots_date"), table_name="kots")
|
|
op.drop_table("kots")
|
|
op.drop_index(op.f("ix_vouchers_date"), table_name="vouchers")
|
|
op.drop_table("vouchers")
|
|
op.drop_table("products")
|
|
op.drop_table("user_roles")
|
|
op.drop_table("section_printers")
|
|
op.drop_table("sale_categories")
|
|
op.drop_table("role_permissions")
|
|
op.drop_table("modifiers")
|
|
op.drop_table("guest_book")
|
|
op.drop_table("food_tables")
|
|
op.drop_table("devices")
|
|
op.drop_table("users")
|
|
op.drop_table("taxes")
|
|
op.drop_table("settle_options")
|
|
op.drop_table("settings")
|
|
op.drop_table("sections")
|
|
op.drop_table("roles")
|
|
op.drop_table("printers")
|
|
op.drop_table("permissions")
|
|
op.drop_table("modifier_categories")
|
|
op.drop_table("menu_categories")
|
|
op.drop_table("customers")
|
|
op.drop_table("clients")
|
|
# ### end Alembic commands ###
|