create table if not exists "InventoryWareHouse"
("InventoryWareHouseId" serial primary key,"Name" text, "Active" boolean default true,"CreatedBy" int references "Account"("AccountId"),
 "CreatedDate" timestamp without time zone,"ModifiedBy" int references "Account"("AccountId"),
 "ModifiedDate" timestamp without time zone
);
alter table "InventoryWareHouse" add column "LocationId" int references "Location"("LocationId");

create table if not exists "InventoryWareHouseUser"(
 "InventoryWareHouseUserId" serial primary key, "InventoryWareHouseId" int references "InventoryWareHouse"("InventoryWareHouseId" ),
 "AccountId" int references "Account"("AccountId"));


insert into "InventoryLogType" ("InventoryLogTypeId","LogTypeName", "Active") values (15,'WareHouse',true);


alter table "InventoryPurchaseDetail" drop column "SerialNo";

alter table "InventoryPurchaseHeader" add column "InventoryWareHouseId" int references "InventoryWareHouse"("InventoryWareHouseId");
 -- Not sure
  alter table "InventoryPurchaseHeader" add column "LocationId" int references "Location"("LocationId");
 ----
alter table "InventoryStock" add column "InventoryWareHouseId" int references "InventoryWareHouse"("InventoryWareHouseId");
-- --> Dont forget to add the update querry for existing data


