-- 实物卡片附属设备修改记录 t_fa_facilityrecord
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_FACILITYRECORD')
CREATE TABLE T_FA_FACILITYRECORD
(
    FID         BIGINT DEFAULT 0 NOT NULL,
    FREALCARDID BIGINT DEFAULT 0 NOT NULL,
    FCREATERID  BIGINT DEFAULT 0 NOT NULL,
    FCREATETIME DATETIME
);

EXEC P_ALTERPK 'PK_T_FA_FACILITYRECORD', 'T_FA_FACILITYRECORD', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_FACITRCOD_CARD') CREATE INDEX IDX_FA_FACITRCOD_CARD ON T_FA_FACILITYRECORD ( FREALCARDID );


