ALTER TABLE Sales_IntroducerRule ADD LASTEDITDATE TIMESTAMP;
ALTER TABLE Sales_IntroducerRule ADD CREATIONDATE TIMESTAMP;

Create Table Sales_MemberInvestHistory
(
	RegisterID Integer NOT NULL,
	MemberID Integer NOT NULL,
	RuleID Integer NOT NULL,
	OrderID Bigint NOT NULL,
	ShopID Integer ,
	Completed Smallint NOT NULL,
	StoreTime Timestamp NOT NULL,
	CutOffDate Timestamp NOT NULL,
	DeleteFlag Smallint NOT NULL,
	StoredValueAmount Numeric(18,2) NOT NULL,
	ClosedAmount Numeric(18,2) NOT NULL,
	InterestAmount Numeric(18,2) NOT NULL,
	SalesWorkerID Integer ,
	ClosedOrderID Bigint ,
	ClosedWorkerID Integer ,
	ClosedDate Timestamp ,
	ClosedIncomeRatePerYear Numeric(18,2) ,
	ClosedReasonNote Varchar(100) CHARACTER SET NONE ,
	IsAHeadOfTime Smallint ,
	OpUserID Integer ,
	Insert_Date Timestamp ,
	Modify_Date Timestamp ,
	RuleType Smallint ,
	RuleName Varchar(140) CHARACTER SET NONE ,
	PeriodOperation Smallint ,
	PeriodType Smallint ,
	PeriodValue Numeric(18,2) ,
	IncomeRatePerYear Numeric(18,4) ,
	RuleNote Varchar(140) CHARACTER SET NONE 
);

alter table  Sales_MemberInvestHistory add primary key(RegisterID, MemberID, RuleID, OrderID);

GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE ON Sales_MemberInvestHistory TO  SYSDBA WITH GRANT OPTION;


















