All of the previous ones including this latest one
**AmazoneClone** **git:(****main****)** **✗** cd src
**➜** **src** **git:(****main****)** **✗** pipenv shell
Launching subshell in virtual environment...
. /Users/abdulmohsenal-sayegh/.local/share/virtualenvs/src-A9O8BnbG/bin/activate
**➜** **src** **git:(****main****)** **✗** . /Users/abdulmohsenal-sayegh/.local/share/virtualenvs/src-A9O8BnbG/bin/activate
(src) **➜** **src** **git:(****main****)** **✗** code .
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0001
BEGIN;
--
-- Create model Coupon
--
CREATE TABLE "orders_coupon" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "code" varchar(20) NOT NULL, "start_date" date NOT NULL, "end_date" date NOT NULL, "quantity" integer NOT NULL, "discount" real NOT NULL);
--
-- Create model Cart
--
CREATE TABLE "orders_cart" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "status" varchar(12) NOT NULL, "total_with_coupon" real NULL, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED);
--
-- Create model CartDetail
--
CREATE TABLE "orders_cartdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "qauntity" integer NOT NULL, "total" real NULL, "order_id" bigint NOT NULL REFERENCES "orders_cart" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
--
-- Create model Order
--
CREATE TABLE "orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total" real NOT NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED);
--
-- Create model OrderDetail
--
CREATE TABLE "orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "qauntity" integer NOT NULL, "price" real NOT NULL, "total" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX "orders_cart_user_id_121a069e" ON "orders_cart" ("user_id");
CREATE INDEX "orders_cart_coupon_id_1516a12b" ON "orders_cart" ("coupon_id");
CREATE INDEX "orders_cartdetail_order_id_091b0028" ON "orders_cartdetail" ("order_id");
CREATE INDEX "orders_cartdetail_product_id_40b59fd6" ON "orders_cartdetail" ("product_id");
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0002
BEGIN;
--
-- Alter field total on order
--
CREATE TABLE "new__orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NULL, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_order" ("id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total") SELECT "id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total" FROM "orders_order";
DROP TABLE "orders_order";
ALTER TABLE "new__orders_order" RENAME TO "orders_order";
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NULL);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", "total" FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0003
BEGIN;
--
-- Alter field end_date on coupon
--
CREATE TABLE "new__orders_coupon" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "end_date" date NULL, "code" varchar(20) NOT NULL, "start_date" date NOT NULL, "quantity" integer NOT NULL, "discount" real NOT NULL);
INSERT INTO "new__orders_coupon" ("id", "code", "start_date", "quantity", "discount", "end_date") SELECT "id", "code", "start_date", "quantity", "discount", "end_date" FROM "orders_coupon";
DROP TABLE "orders_coupon";
ALTER TABLE "new__orders_coupon" RENAME TO "orders_coupon";
--
-- Alter field total on order
--
CREATE TABLE "new__orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NOT NULL);
INSERT INTO "new__orders_order" ("id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total") SELECT "id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", coalesce("total", NULL) FROM "orders_order";
DROP TABLE "orders_order";
ALTER TABLE "new__orders_order" RENAME TO "orders_order";
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0004
BEGIN;
--
-- Alter field end_date on coupon
--
CREATE TABLE "new__orders_coupon" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "end_date" date NULL, "code" varchar(20) NOT NULL, "start_date" date NOT NULL, "quantity" integer NOT NULL, "discount" real NOT NULL);
INSERT INTO "new__orders_coupon" ("id", "code", "start_date", "quantity", "discount", "end_date") SELECT "id", "code", "start_date", "quantity", "discount", "end_date" FROM "orders_coupon";
DROP TABLE "orders_coupon";
ALTER TABLE "new__orders_coupon" RENAME TO "orders_coupon";
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0005
BEGIN;
--
-- Alter field end_date on coupon
--
CREATE TABLE "new__orders_coupon" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "end_date" date NULL, "code" varchar(20) NOT NULL, "start_date" date NOT NULL, "quantity" integer NOT NULL, "discount" real NOT NULL);
INSERT INTO "new__orders_coupon" ("id", "code", "start_date", "quantity", "discount", "end_date") SELECT "id", "code", "start_date", "quantity", "discount", "end_date" FROM "orders_coupon";
DROP TABLE "orders_coupon";
ALTER TABLE "new__orders_coupon" RENAME TO "orders_coupon";
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0006
BEGIN;
--
-- Alter field total on cartdetail
--
CREATE TABLE "new__orders_cartdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" decimal NOT NULL, "qauntity" integer NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_cart" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_cartdetail" ("id", "qauntity", "order_id", "product_id", "total") SELECT "id", "qauntity", "order_id", "product_id", coalesce("total", '0.00') FROM "orders_cartdetail";
DROP TABLE "orders_cartdetail";
ALTER TABLE "new__orders_cartdetail" RENAME TO "orders_cartdetail";
CREATE INDEX "orders_cartdetail_order_id_091b0028" ON "orders_cartdetail" ("order_id");
CREATE INDEX "orders_cartdetail_product_id_40b59fd6" ON "orders_cartdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0007
BEGIN;
--
-- Alter field total on cartdetail
--
CREATE TABLE "new__orders_cartdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NULL, "qauntity" integer NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_cart" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_cartdetail" ("id", "qauntity", "order_id", "product_id", "total") SELECT "id", "qauntity", "order_id", "product_id", "total" FROM "orders_cartdetail";
DROP TABLE "orders_cartdetail";
ALTER TABLE "new__orders_cartdetail" RENAME TO "orders_cartdetail";
CREATE INDEX "orders_cartdetail_order_id_091b0028" ON "orders_cartdetail" ("order_id");
CREATE INDEX "orders_cartdetail_product_id_40b59fd6" ON "orders_cartdetail" ("product_id");
--
-- Alter field total on order
--
CREATE TABLE "new__orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NULL);
INSERT INTO "new__orders_order" ("id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total") SELECT "id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total" FROM "orders_order";
DROP TABLE "orders_order";
ALTER TABLE "new__orders_order" RENAME TO "orders_order";
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0008
BEGIN;
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NOT NULL, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", coalesce("total", 1.0) FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0009
BEGIN;
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NULL, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", "total" FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0010
BEGIN;
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NULL, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", "total" FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0011
BEGIN;
--
-- Alter field end_date on coupon
--
CREATE TABLE "new__orders_coupon" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "end_date" date NULL, "code" varchar(20) NOT NULL, "start_date" date NOT NULL, "quantity" integer NOT NULL, "discount" real NOT NULL);
INSERT INTO "new__orders_coupon" ("id", "code", "start_date", "quantity", "discount", "end_date") SELECT "id", "code", "start_date", "quantity", "discount", "end_date" FROM "orders_coupon";
DROP TABLE "orders_coupon";
ALTER TABLE "new__orders_coupon" RENAME TO "orders_coupon";
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0012
BEGIN;
--
-- Alter field total on order
--
CREATE TABLE "new__orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NOT NULL, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_order" ("id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total") SELECT "id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", coalesce("total", 0.0) FROM "orders_order";
DROP TABLE "orders_order";
ALTER TABLE "new__orders_order" RENAME TO "orders_order";
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0013
BEGIN;
--
-- Alter field total on cartdetail
--
CREATE TABLE "new__orders_cartdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NOT NULL, "qauntity" integer NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_cart" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_cartdetail" ("id", "qauntity", "order_id", "product_id", "total") SELECT "id", "qauntity", "order_id", "product_id", coalesce("total", 0.0) FROM "orders_cartdetail";
DROP TABLE "orders_cartdetail";
ALTER TABLE "new__orders_cartdetail" RENAME TO "orders_cartdetail";
CREATE INDEX "orders_cartdetail_order_id_091b0028" ON "orders_cartdetail" ("order_id");
CREATE INDEX "orders_cartdetail_product_id_40b59fd6" ON "orders_cartdetail" ("product_id");
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NOT NULL);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", coalesce("total", 0.0) FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗** python manage.py sqlmigrate orders 0014
BEGIN;
--
-- Alter field total on cartdetail
--
CREATE TABLE "new__orders_cartdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "total" real NULL, "qauntity" integer NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_cart" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED);
INSERT INTO "new__orders_cartdetail" ("id", "qauntity", "order_id", "product_id", "total") SELECT "id", "qauntity", "order_id", "product_id", "total" FROM "orders_cartdetail";
DROP TABLE "orders_cartdetail";
ALTER TABLE "new__orders_cartdetail" RENAME TO "orders_cartdetail";
CREATE INDEX "orders_cartdetail_order_id_091b0028" ON "orders_cartdetail" ("order_id");
CREATE INDEX "orders_cartdetail_product_id_40b59fd6" ON "orders_cartdetail" ("product_id");
--
-- Alter field total on order
--
CREATE TABLE "new__orders_order" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "status" varchar(12) NOT NULL, "code" varchar(20) NOT NULL, "order_time" datetime NOT NULL, "delivery_time" datetime NULL, "total_with_coupon" real NULL, "coupon_id" bigint NULL REFERENCES "orders_coupon" ("id") DEFERRABLE INITIALLY DEFERRED, "delivery_address_id" bigint NULL REFERENCES "accounts_address" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NULL);
INSERT INTO "new__orders_order" ("id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total") SELECT "id", "status", "code", "order_time", "delivery_time", "total_with_coupon", "coupon_id", "delivery_address_id", "user_id", "total" FROM "orders_order";
DROP TABLE "orders_order";
ALTER TABLE "new__orders_order" RENAME TO "orders_order";
CREATE INDEX "orders_order_coupon_id_5bddb887" ON "orders_order" ("coupon_id");
CREATE INDEX "orders_order_delivery_address_id_6ecfdbf4" ON "orders_order" ("delivery_address_id");
CREATE INDEX "orders_order_user_id_e9b59eb1" ON "orders_order" ("user_id");
--
-- Alter field total on orderdetail
--
CREATE TABLE "new__orders_orderdetail" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "qauntity" integer NOT NULL, "price" real NOT NULL, "order_id" bigint NOT NULL REFERENCES "orders_order" ("id") DEFERRABLE INITIALLY DEFERRED, "product_id" bigint NULL REFERENCES "products_product" ("id") DEFERRABLE INITIALLY DEFERRED, "total" real NULL);
INSERT INTO "new__orders_orderdetail" ("id", "qauntity", "price", "order_id", "product_id", "total") SELECT "id", "qauntity", "price", "order_id", "product_id", "total" FROM "orders_orderdetail";
DROP TABLE "orders_orderdetail";
ALTER TABLE "new__orders_orderdetail" RENAME TO "orders_orderdetail";
CREATE INDEX "orders_orderdetail_order_id_8d02dd1f" ON "orders_orderdetail" ("order_id");
CREATE INDEX "orders_orderdetail_product_id_3ecd225e" ON "orders_orderdetail" ("product_id");
COMMIT;
(src) **➜** **src** **git:(****main****)** **✗**