This commit is contained in:
@@ -37,6 +37,7 @@ todo: api / server landing page is shitty on a mobile
|
||||
todo: Should server show uptime somewhere?
|
||||
todo: Log configuration into server log at startup? https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3523
|
||||
log all config settings into server log on boot
|
||||
todo:aycontext clean up old block of weird definitions
|
||||
todo: Is there a log that records past jobs, how long can they be viewed?
|
||||
todo: Rename the link to AyaNova App on the server page to just "AyaNova"
|
||||
todo: translation cjkindex, no way to set this value currently
|
||||
|
||||
@@ -24,7 +24,8 @@ namespace AyaNova.Biz
|
||||
ServerStateChange=9,
|
||||
SeedDatabase=10,
|
||||
AttachmentModified=11,
|
||||
EraseAllData=12
|
||||
EraseAllData=12,
|
||||
ResetSerial=13
|
||||
|
||||
//NEW ITEMS REQUIRE translation KEYS and update CLIENT ay-history.vue code in eventypes list and translation fetcher
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
else
|
||||
{
|
||||
// newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
||||
// newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
||||
newObject.Tags = TagUtil.NormalizeTags(newObject.Tags);
|
||||
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||
await ct.Widget.AddAsync(newObject);
|
||||
@@ -98,7 +98,7 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//UPDATE
|
||||
//
|
||||
@@ -172,16 +172,31 @@ namespace AyaNova.Biz
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//RESET SERIAL
|
||||
//
|
||||
internal async Task<bool> ResetSerial(long newSerial)
|
||||
{
|
||||
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.ResetSerial,newSerial.ToString()), ct);
|
||||
|
||||
|
||||
/*
|
||||
ALTER TABLE table_name
|
||||
ALTER COLUMN column_name
|
||||
{ SET GENERATED { ALWAYS| BY DEFAULT } |
|
||||
SET sequence_option | RESTART [ [ WITH ] restart ] }
|
||||
*/
|
||||
|
||||
|
||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
command.CommandText = $"alter table awidget alter column serial restart with {newSerial}";
|
||||
await ct.Database.OpenConnectionAsync();
|
||||
await command.ExecuteNonQueryAsync();
|
||||
await ct.Database.CloseConnectionAsync();
|
||||
}
|
||||
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 0, BizType, AyaEvent.ResetSerial, newSerial.ToString()), ct);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,16 @@ namespace AyaNova.Models
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
//SERIALIZED OBJECTS
|
||||
//
|
||||
modelBuilder.Entity<Widget>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//TODO: this entire block is almost certainly wrong or not required
|
||||
|
||||
//Indexes must be specified through fluent api unfortunately
|
||||
modelBuilder.Entity<FileAttachment>().HasIndex(p => p.StoredFileName);
|
||||
|
||||
@@ -136,14 +146,11 @@ namespace AyaNova.Models
|
||||
.WithOne(i => i.User)
|
||||
.HasForeignKey<Widget>(b => b.UserId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<Widget>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||
|
||||
// //Workorder
|
||||
// modelBuilder.Entity<WorkOrderItem>()
|
||||
// .HasOne(p => p.WorkOrder)
|
||||
// .WithMany(b => b.WorkorderItems);
|
||||
|
||||
|
||||
//-----------
|
||||
|
||||
@@ -1646,6 +1646,7 @@
|
||||
"EventLicenseTrialRequest": "Testlizenz angefordert",
|
||||
"EventServerStateChange": "Serverstatus geändert",
|
||||
"EventSeedDatabase": "Datenbank mit Beispieldaten erstellt",
|
||||
"EventResetSerial":"Seriennummer zurückgesetzt",
|
||||
"NoType": "Kein Typ",
|
||||
"License": "Lizenz",
|
||||
"LogFile": "Logdatei",
|
||||
|
||||
@@ -1646,6 +1646,7 @@
|
||||
"EventLicenseTrialRequest": "Trial license requested",
|
||||
"EventServerStateChange": "Server state changed",
|
||||
"EventSeedDatabase": "Database seeded with trial data",
|
||||
"EventResetSerial":"Serial number reset",
|
||||
"NoType": "No type",
|
||||
"License": "License",
|
||||
"LogFile": "Log file",
|
||||
|
||||
@@ -1646,6 +1646,7 @@
|
||||
"EventLicenseTrialRequest": "Licencia de prueba solicitada",
|
||||
"EventServerStateChange": "Estado del servidor cambiado",
|
||||
"EventSeedDatabase": "Base de datos creada con datos de muestra",
|
||||
"EventResetSerial":"Restablecimiento de número de serie",
|
||||
"NoType": "Sin tipo",
|
||||
"License": "Licencia",
|
||||
"LogFile": "Archivo de registro",
|
||||
|
||||
@@ -1646,6 +1646,7 @@
|
||||
"EventLicenseTrialRequest": "Licence d'essai demandée",
|
||||
"EventServerStateChange": "L'état du serveur a changé",
|
||||
"EventSeedDatabase": "Base de données créée avec des exemples de données",
|
||||
"EventResetSerial":"Réinitialisation du numéro de série",
|
||||
"NoType": "Aucun type",
|
||||
"License": "Licence",
|
||||
"LogFile": "Fichier journal",
|
||||
|
||||
Reference in New Issue
Block a user