This commit is contained in:
@@ -33,6 +33,7 @@ namespace AyaNova.Models
|
|||||||
|
|
||||||
public virtual DbSet<NotifySubscription> NotifySubscription { get; set; }
|
public virtual DbSet<NotifySubscription> NotifySubscription { get; set; }
|
||||||
public virtual DbSet<NotifyEvent> NotifyEvent { get; set; }
|
public virtual DbSet<NotifyEvent> NotifyEvent { get; set; }
|
||||||
|
public virtual DbSet<Notification> Notification { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Part> Part { get; set; }
|
public virtual DbSet<Part> Part { get; set; }
|
||||||
public virtual DbSet<PM> PM { get; set; }
|
public virtual DbSet<PM> PM { get; set; }
|
||||||
|
|||||||
34
server/AyaNova/models/Notification.cs
Normal file
34
server/AyaNova/models/Notification.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace AyaNova.Models
|
||||||
|
{
|
||||||
|
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
|
||||||
|
//otherwise the server will call it an invalid record if the field isn't sent from client
|
||||||
|
|
||||||
|
public class Notification
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
public AyaType? AyaType { get; set; }
|
||||||
|
public long? ObjectId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public NotifyEventType EventType { get; set; }
|
||||||
|
[Required]
|
||||||
|
public long SubscriptionId { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
|
||||||
|
public Notification()
|
||||||
|
{
|
||||||
|
Created = DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
43
server/AyaNova/models/NotifyDeliveryLog.cs
Normal file
43
server/AyaNova/models/NotifyDeliveryLog.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace AyaNova.Models
|
||||||
|
{
|
||||||
|
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
|
||||||
|
//otherwise the server will call it an invalid record if the field isn't sent from client
|
||||||
|
|
||||||
|
public class NotifyDeliveryLog
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public DateTime Processed { get; set; }
|
||||||
|
public AyaType? AyaType { get; set; }
|
||||||
|
public long? ObjectId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public NotifyEventType EventType { get; set; }
|
||||||
|
[Required]
|
||||||
|
public long SubscriptionId { get; set; }
|
||||||
|
public long? IdValue { get; set; }
|
||||||
|
public decimal? DecValue { get; set; }
|
||||||
|
[Required]
|
||||||
|
public long UserId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public NotifyDeliveryMethod DeliveryMethod { get; set; }
|
||||||
|
[Required]
|
||||||
|
public bool Fail { get; set; }
|
||||||
|
public string Error { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public NotifyDeliveryLog()
|
||||||
|
{
|
||||||
|
Processed = DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
@@ -687,10 +687,12 @@ $BODY$;
|
|||||||
await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, " +
|
await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, " +
|
||||||
"ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), eventdate timestamp, message text");
|
"ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), eventdate timestamp, message text");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, message text");
|
await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, ayatype integer, objectid bigint, eventtype integer not null, " +
|
||||||
|
"subscriptionid bigint not null, message text");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, ayatype integer, objectid bigint, "+
|
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed timestamp not null, ayatype integer, objectid bigint, " +
|
||||||
"eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), processed timestamp not null, touserid bigint not null, deliverymethod integer not null, fail bool, error text");
|
"eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), userid bigint not null, " +
|
||||||
|
"deliverymethod integer not null, fail bool not null, error text");
|
||||||
|
|
||||||
await SetSchemaLevelAsync(++currentSchema);
|
await SetSchemaLevelAsync(++currentSchema);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user