This commit is contained in:
2021-08-02 22:28:30 +00:00
parent 5ecf1a2620
commit f522dda8f1
9 changed files with 104 additions and 41 deletions

View File

@@ -415,7 +415,7 @@ BEGIN
when 47 then return 'LT:GlobalOps';
when 48 then return 'LT:BizMetrics';
when 49 then return 'LT:Backup';
when 50 then aytable = 'anotification';
when 50 then aytable = 'ainappnotification';
when 51 then return 'LT:NotifySubscription';
when 52 then aytable = 'areminder';
when 53 then return 'LT:UnitMeterReading';
@@ -1110,13 +1110,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
+ "userid BIGINT NOT NULL REFERENCES auser (id), eventdate TIMESTAMP NOT NULL, decvalue DECIMAL(38,18) NULL, message TEXT)");
await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL REFERENCES auser (id), "
await ExecQueryAsync("CREATE TABLE ainappnotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL REFERENCES auser (id), "
+ "created TIMESTAMP NOT NULL, ayatype INTEGER NOT NULL, objectid BIGINT NOT NULL, name TEXT NOT NULL, agevalue INTERVAL, eventtype INTEGER NOT NULL, "
+ "decvalue DECIMAL(38,18) NULL, notifysubscriptionid BIGINT NOT NULL REFERENCES anotifysubscription(id) ON DELETE CASCADE, message TEXT, fetched BOOL NOT NULL)");
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed TIMESTAMP NOT NULL, "
+ "ayatype INTEGER NOT NULL, objectid BIGINT NOT NULL, eventtype INTEGER NOT NULL, notifysubscriptionid BIGINT NOT NULL, idvalue BIGINT NOT NULL, "
+ "decvalue DECIMAL(38,18) NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id), deliverymethod INTEGER NOT NULL, fail BOOL NOT NULL, error TEXT)");
+ "objectid BIGINT NOT NULL, notifysubscriptionid BIGINT NOT NULL, fail BOOL NOT NULL, error TEXT)");
//LOGO
await ExecQueryAsync("CREATE TABLE alogo (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "

View File

@@ -423,7 +423,7 @@ namespace AyaNova.Util
await EraseTableAsync("acontract", conn);
//----- NOTIFICATION
await EraseTableAsync("anotification", conn);
await EraseTableAsync("ainappnotification", conn);
await EraseTableAsync("anotifyevent", conn);
await EraseTableAsync("anotifydeliverylog", conn);
await EraseTableAsync("anotifysubscription", conn);