Fix: Import was not working as Customer Model changed and borked the initial commit of the database. Created a table in the function to remove dependence from the model.

Now poetry requires "poetry run" before commands to run them in the container. Updated for it.
This commit is contained in:
tanshu committed 2021-07-31 16:26:25 +05:30
1 parent eedc571ade
commit afa4fd4711
2 files changed
+12 -6

No files matched your search

@@ -8,7 +8,6 @@ Create Date: 2020-06-04 08:14:34.132248
import sqlalchemy as sa
from alembic import op
from barker.models.customer import Customer
from barker.models.db_setting import DbSetting
from barker.models.modifier_category import ModifierCategory
from barker.models.permission import Permission
@@ -77,8 +76,15 @@ def settle_options():
op.execute(so.insert().values(id=8, name="Amount", show_in_choices=False, display_group=1, is_print=False))
op.execute(so.insert().values(id=9, name="Void", show_in_choices=True, display_group=1, is_print=True))
op.execute(so.insert().values(id=10, name="Staff", show_in_choices=True, display_group=4, is_print=True))
customer = table(
"customers",
column("id", postgresql.UUID(as_uuid=True)),
column("name", sa.Unicode(length=255)),
column("phone", sa.Unicode(length=255)),
column("address", sa.Unicode(length=255)),
)
op.execute(
Customer.__table__.insert().values(
customer.insert().values(
id="2c716f4b-0736-429a-ad51-610d7c47cb5e",
name="Cash",
phone="",