This commit is contained in:
@@ -177,26 +177,20 @@ namespace AyaNova.Biz
|
||||
//
|
||||
internal async Task<bool> ResetSerial(long newSerial)
|
||||
{
|
||||
|
||||
/*
|
||||
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 ct.Database.CloseConnectionAsync();
|
||||
}
|
||||
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 0, BizType, AyaEvent.ResetSerial, newSerial.ToString()), ct);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user