﻿if not Exists(SELECT * FROM information_schema.tables where Table_name = 'BargehGold')
begin
	create table dbo.BargehGold
	(
		ID	int primary key identity (1,1),
		Bar_ID	int references dbo.Bargeh(ID) not null,
		Dom_ID_RowType	int references dbo.Domain(ID) not null,
		Kal_ID	int references dbo.Kala(ID) null,
		Taf_ID	bigint references dbo.Tafsili(ID) null,
		Pro_ID_Vahed	int references dbo.OtherProperties(ID) null, -- واحد
		Dom_ID_UnitType	int references dbo.Domain(ID) not null, -- وزنی، ریالی
		Dom_ID_Nature	int references dbo.Domain(ID) null,
		Quantity	decimal (19,4) null,		-- مقدار/تعداد
		Price	decimal (19,4) null,	-- مبلغ
		PriceBoard	decimal (19,4) null,	-- مبلغ تابلو
		Cnt	int null,	-- تعداد
		Karat	int null,	-- عیار
		
		SystemTitle	nvarchar(max),
		[Description]	nvarchar(1000),
		[Guid]	nvarchar(200)
	)
end