diff --git a/Controllers/SiteController.cs b/Controllers/SiteController.cs index 87b3272..c61624e 100644 --- a/Controllers/SiteController.cs +++ b/Controllers/SiteController.cs @@ -119,7 +119,7 @@ namespace rockfishCore.Controllers return BadRequest(ModelState); } - var site = await _context.Site.SingleOrDefaultAsync(m => m.Id == id); + var site = await _context.Site.AsNoTracking().SingleOrDefaultAsync(m => m.Id == id); if (site == null) { diff --git a/Startup.cs b/Startup.cs index e21d703..f9ddd91 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,32 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using rockfishCore.Models; using rockfishCore.Util; using Microsoft.EntityFrameworkCore; -using System.IO; -using System.Reflection; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.Extensions.Options; - - - namespace rockfishCore { @@ -77,7 +62,7 @@ namespace rockfishCore }; }); - + } @@ -106,16 +91,20 @@ namespace rockfishCore //Check schema RfSchema.CheckAndUpdate(dbContext); - app.UseHttpsRedirection(); + // app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => - { + { endpoints.MapControllers(); }); + + //server ready + System.Diagnostics.Debug.WriteLine("BOOT COMPLETED - OPEN"); + } } } diff --git a/util/RfSchema.cs b/util/RfSchema.cs index 1468b0a..1119fe0 100644 --- a/util/RfSchema.cs +++ b/util/RfSchema.cs @@ -363,14 +363,13 @@ namespace rockfishCore.Util ////////////////////////////////////////////////// //schema 16 RAVEN stuff if (currentSchema < 16) - { - + { exec("CREATE TABLE trialrequest (" + "id INTEGER PRIMARY KEY, dbid text not null, companyname text not null, contactname text not null, notes text, email text not null, " + - "emailvalidated boolean default 0 NOT NULL CHECK (emailvalidated IN (0,1)) dtrequested integer, " + - "dtprocessed integer, status integer default 0 not null, rejectreason text, key text, dtfetched integer, fetched boolean default 0 NOT NULL CHECK (fetched IN (0,1))" + + "emailvalidated boolean default 0 NOT NULL CHECK (emailvalidated IN (0,1)), dtrequested integer, " + + "dtprocessed integer, status integer default 0 not null, rejectreason text, key text, dtfetched integer" + ")"); - exec("alter table site add legacyv7 boolean default 0 NOT NULL CHECK (fetched IN (0,1))"); + exec("alter table site add legacyv7 boolean default 0 NOT NULL CHECK (legacyv7 IN (0,1))"); exec("alter table site add dbid text default 'v7_no_dbid' NOT NULL"); exec("update site set legacyv7 = 1"); exec("alter table license add dbid text default 'v7_no_dbid' NOT NULL"); diff --git a/wwwroot/default.htm b/wwwroot/default.htm index 9b5d2e3..4f02dcc 100644 --- a/wwwroot/default.htm +++ b/wwwroot/default.htm @@ -11,69 +11,69 @@