TSQLDiaper = class(TSQLRecord) private fSerialNumber: RawUTF8; fModel: TSQLDiaperModel; fBaby: TSQLBaby; published property SerialNumber: RawUTF8 index 30 read fSerialNumber write fSerialNumber stored AS_UNIQUE; property Model: TSQLDiaperModel read fModel write fModel; property Baby: TSQLBaby read fBaby write fBaby; end;
字段后面加 stored AS_UNIQUE;
就会创建索引