-
Notifications
You must be signed in to change notification settings - Fork 2
Recording Statistics with SQL Server
Peter Chapman edited this page Jan 10, 2023
·
2 revisions
The GoTo.Bible application supports recording of statistics using Microsoft SQL Server or MySQL. This is often required for reporting back to copyright providers.
CREATE TABLE [dbo].[Statistics](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[IpAddress] [varchar](39) NULL,
[ForwardedFor] [varchar](max) NULL,
[PrimaryTranslation] [varchar](50) NOT NULL,
[PrimaryProvider] [varchar](50) NOT NULL,
[SecondaryTranslation] [varchar](50) NULL,
[SecondaryProvider] [varchar](50) NULL,
[Passage] [varchar](max) NOT NULL,
[AccessedAt] [datetime2](7) NOT NULL,
CONSTRAINT [PK_Statistics] PRIMARY KEY CLUSTERED ([Id])
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
The following configuration can be using with SQL LocalDB, assuming you have already created a database called GoToBible:
dotnet user-secrets set "Providers:Statistics:DatabaseProvider" "mssql"
dotnet user-secrets set "Providers:Statistics:ConnectionString" "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=GoToBible;Integrated Security=True;"