-
Notifications
You must be signed in to change notification settings - Fork 1
Recording Statistics with MySQL
Peter Chapman edited this page Apr 2, 2021
·
6 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 IF NOT EXISTS`statistics` (
`Id` BIGINT NOT NULL AUTO_INCREMENT,
`IpAddress` VARCHAR(39) NULL,
`ForwardedFor` LONGTEXT NULL,
`PrimaryTranslation` VARCHAR(50) NOT NULL,
`PrimaryProvider` VARCHAR(50) NOT NULL,
`SecondaryTranslation` VARCHAR(50) NULL,
`SecondaryProvider` VARCHAR(50) NULL,
`Passage` LONGTEXT NOT NULL,
`AccessedAt` DATETIME NOT NULL,
PRIMARY KEY (`Id`)
);The following configuration can be using with MySQL, assuming you have already created a database called GoToBible:
dotnet user-secrets set "Providers:Statistics:DatabaseProvider" "mysql"
dotnet user-secrets set "Providers:Statistics:ConnectionString" "Server=localhost;Database=GoToBible;User=root;Password="
The following configuration can be using with MariaDB, assuming you have already created a database called GoToBible:
dotnet user-secrets set "Providers:Statistics:DatabaseProvider" "mariadb"
dotnet user-secrets set "Providers:Statistics:ConnectionString" "Server=localhost;Database=GoToBible;User=root;Password="
The following configuration can be using with MySQL if you are running a specific version of MySQL:
dotnet user-secrets set "Providers:Statistics:DatabaseProvider" "mysql"
dotnet user-secrets set "Providers:Statistics:DatabaseVersion" "8.0.21"
dotnet user-secrets set "Providers:Statistics:ConnectionString" "Server=localhost;Database=GoToBible;User=root;Password="
NOTE: This is currently broken in Pomelo.EntityFramework.Core 5.0.0-alpha.2, and will be fixed in Pomelo.EntityFramework.Core 5.0.0-alpha-3