|
|
|
@ -7,12 +7,13 @@ Create Date: 2020-06-04 08:14:34.132248
|
|
|
|
|
"""
|
|
|
|
|
import uuid
|
|
|
|
|
|
|
|
|
|
from alembic import op
|
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
from alembic import op
|
|
|
|
|
from barker.models import Customer, DbSetting, ModifierCategory, Section, SettleOption
|
|
|
|
|
from barker.models.auth import Permission, User # noqa
|
|
|
|
|
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"
|
|
|
|
@ -137,7 +138,9 @@ def upgrade():
|
|
|
|
|
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.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")),
|
|
|
|
|
)
|
|
|
|
@ -149,7 +152,11 @@ def upgrade():
|
|
|
|
|
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.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")),
|
|
|
|
|
)
|
|
|
|
@ -159,7 +166,11 @@ def upgrade():
|
|
|
|
|
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.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(
|
|
|
|
@ -184,18 +195,26 @@ def upgrade():
|
|
|
|
|
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")
|
|
|
|
|
["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.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")),
|
|
|
|
|
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.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")),
|
|
|
|
|
)
|
|
|
|
@ -211,18 +230,34 @@ def upgrade():
|
|
|
|
|
["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.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")),
|
|
|
|
|
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.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")),
|
|
|
|
|
)
|
|
|
|
@ -240,10 +275,14 @@ def upgrade():
|
|
|
|
|
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")
|
|
|
|
|
["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")
|
|
|
|
|
["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")),
|
|
|
|
@ -263,13 +302,23 @@ def upgrade():
|
|
|
|
|
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")
|
|
|
|
|
["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.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(
|
|
|
|
|
"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)
|
|
|
|
@ -281,9 +330,17 @@ def upgrade():
|
|
|
|
|
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.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")),
|
|
|
|
|
)
|
|
|
|
@ -297,14 +354,20 @@ def upgrade():
|
|
|
|
|
sa.ForeignKeyConstraint(
|
|
|
|
|
["modifier_categories_id"],
|
|
|
|
|
["modifier_categories.id"],
|
|
|
|
|
name=op.f("fk_modifier_categories_products_modifier_categories_id_modifier_categories"),
|
|
|
|
|
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")
|
|
|
|
|
["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")
|
|
|
|
|
"product_id",
|
|
|
|
|
"modifier_categories_id",
|
|
|
|
|
name=op.f("uq_modifier_categories_products_product_id"),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
op.create_table(
|
|
|
|
@ -315,12 +378,20 @@ def upgrade():
|
|
|
|
|
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")
|
|
|
|
|
["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")
|
|
|
|
|
["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.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")),
|
|
|
|
@ -332,24 +403,44 @@ def upgrade():
|
|
|
|
|
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.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_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.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")),
|
|
|
|
|
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_index(op.f("ix_settlements_voucher_id"), "settlements", ["voucher_id"], unique=False)
|
|
|
|
|
op.create_table(
|
|
|
|
|
"inventories",
|
|
|
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
|
|
@ -362,13 +453,29 @@ def upgrade():
|
|
|
|
|
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.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")),
|
|
|
|
|
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_index(op.f("ix_inventories_kot_id"), "inventories", ["kot_id"], unique=False)
|
|
|
|
|
op.create_table(
|
|
|
|
|
"inventory_modifiers",
|
|
|
|
|
sa.Column("id", postgresql.UUID(), nullable=False),
|
|
|
|
@ -376,20 +483,48 @@ def upgrade():
|
|
|
|
|
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")
|
|
|
|
|
["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")
|
|
|
|
|
["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")),
|
|
|
|
|
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(
|
|
|
|
|
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(
|
|
|
|
@ -454,15 +589,25 @@ def upgrade():
|
|
|
|
|
|
|
|
|
|
op.execute(
|
|
|
|
|
SettleOption.__table__.insert().values(
|
|
|
|
|
id=1, name="Unsettled", show_in_choices=False, display_group=1, is_print=True
|
|
|
|
|
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)
|
|
|
|
|
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
|
|
|
|
|
id=3,
|
|
|
|
|
name="Credit Card",
|
|
|
|
|
show_in_choices=True,
|
|
|
|
|
display_group=2,
|
|
|
|
|
is_print=True,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
@ -472,15 +617,25 @@ def upgrade():
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
|
SettleOption.__table__.insert().values(
|
|
|
|
|
id=5, name="Bill To Company", show_in_choices=True, display_group=2, is_print=True
|
|
|
|
|
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)
|
|
|
|
|
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
|
|
|
|
|
id=7,
|
|
|
|
|
name="Round Off",
|
|
|
|
|
show_in_choices=False,
|
|
|
|
|
display_group=1,
|
|
|
|
|
is_print=False,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
@ -489,7 +644,9 @@ def upgrade():
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
|
SettleOption.__table__.insert().values(id=9, name="Void", show_in_choices=True, display_group=1, is_print=True)
|
|
|
|
|
SettleOption.__table__.insert().values(
|
|
|
|
|
id=9, name="Void", show_in_choices=True, display_group=1, is_print=True
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
|
SettleOption.__table__.insert().values(
|
|
|
|
@ -498,7 +655,11 @@ def upgrade():
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
|
Customer.__table__.insert().values(
|
|
|
|
|
id="2c716f4b-0736-429a-ad51-610d7c47cb5e", company="", name="Cash", phone="", address=""
|
|
|
|
|
id="2c716f4b-0736-429a-ad51-610d7c47cb5e",
|
|
|
|
|
company="",
|
|
|
|
|
name="Cash",
|
|
|
|
|
phone="",
|
|
|
|
|
address="",
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
op.execute(
|
|
|
|
|