﻿--Migration
IF OBJECT_ID('dbo.T_OSZTONDIJHISTORY') IS NULL
CREATE TABLE dbo.T_OSZTONDIJHISTORY(
  ID INT NOT NULL,
  C_ENTITYID int NOT NULL,
  C_TABLEID tinyint NOT NULL,
  C_ALTERATIONDATE datetime NOT NULL,
  C_REASONID tinyint NOT NULL, -- 1:(New) INSERT, 2:(Removed) DELETE, 3:(Modified) UPDATE
  C_FELHASZNALOID int NULL,
  C_TANULOID int NOT NULL,
  C_TANEVID int NOT NULL,
  C_PROPERTYNAME varchar (100) COLLATE Hungarian_CI_AI NOT NULL,
  C_ORIGINALVALUE nvarchar (2000) COLLATE Hungarian_CI_AI NULL,
  C_CURRENTVALUE nvarchar (2000) COLLATE Hungarian_CI_AI NULL,
  CONSTRAINT PK_OsztondijHistory PRIMARY KEY CLUSTERED (C_TANEVID, C_TANULOID, ID, C_PROPERTYNAME)
    WITH (DATA_COMPRESSION = PAGE, FILLFACTOR = 100)
)
