fix(storage): schema inconsistency (#4262)

pull/4405/head
James Elliott 2022-11-19 16:47:09 +11:00 committed by GitHub
parent d32e58c457
commit 194d34106e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
140 changed files with 3458 additions and 1010 deletions

View File

@ -98,11 +98,7 @@ func genCLIDocWriteIndex(path, name string) (err error) {
return err
}
weight := 900
if name == "authelia" {
weight = 320
}
weight := genCLIDocCmdToWeight(name)
_, err = fmt.Fprintf(f, indexDocs, name, now.Format(dateFmtYAML), "cli-"+name, weight)
@ -119,14 +115,28 @@ func prepend(input string) string {
args := strings.Join(parts, " ")
weight := 330
if len(parts) == 1 {
weight = 320
weight := genCLIDocCmdToWeight(parts[0])
if len(parts) != 1 {
weight += 5
}
return fmt.Sprintf(prefixDocs, args, fmt.Sprintf("Reference for the %s command.", args), "", now.Format(dateFmtYAML), "cli-"+cmd, weight)
}
func genCLIDocCmdToWeight(cmd string) int {
switch cmd {
case "authelia":
return 900
case "authelia-gen":
return 910
case "authelia-scripts":
return 920
default:
return 990
}
}
func linker(input string) string {
return input
}

View File

@ -7,5 +7,5 @@
package cmd
const (
versionSwaggerUI = "4.15.2"
versionSwaggerUI = "4.15.5"
)

View File

@ -35,3 +35,4 @@ this instance if you wanted to downgrade to pre1 you would need to use an Authel
| 4 | 4.35.0 | Added OpenID Connect storage tables and opaque user identifier tables |
| 5 | 4.35.1 | Fixed the oauth2_consent_session table to accept NULL subjects for users who are not yet signed in |
| 6 | 4.37.0 | Adjusted the OpenID Connect tables to allow pre-configured consent improvements |
| 7 | 4.37.3 | Fixed some schema inconsistencies most notably the MySQL/MariaDB Engine and Collation |

View File

@ -17,19 +17,8 @@ aliases:
## Version support
When using [MySQL] or [MariaDB] we recommend using the latest version that is officially supported by the [MySQL] or
[MariaDB] developers. We also suggest checking out [PostgreSQL](postgres.md) as an alternative.
The oldest versions that have been tested are [MySQL] 5.7 and [MariaDB] 10.6.
If using [MySQL] 5.7 or [MariaDB] 10.6 you may be required to adjust the `explicit_defaults_for_timestamp` setting. This
will be evident when the container starts with an error similar to `Error 1067: Invalid default value for 'exp'`. You
can adjust this setting in the mysql.cnf file like so:
```cnf
[mysqld]
explicit_defaults_for_timestamp = 1
```
See the [MySQL Database Integration](../../reference/integrations/database-integrations.md#mysql) reference
guide for supported version information.
## Configuration

View File

@ -16,17 +16,8 @@ aliases:
## Version support
See [PostgreSQL support](https://www.postgresql.org/support/versioning/) for the versions supported by [PostgreSQL]. We
recommend the *current minor* version of one of the versions supported by [PostgreSQL].
The versions of [PostgreSQL] that should be supported by Authelia are:
* 14
* 13
* 12
* 11
* 10
* 9.6
See the [PostgreSQL Database Integration](../../reference/integrations/database-integrations.md#postgresql) reference
guide for supported version information.
## Configuration

View File

@ -0,0 +1,64 @@
---
title: "Database Schema"
description: "Authelia Development Database Schema Guidelines"
lead: "This section covers the database schema guidelines we use for development."
date: 2022-11-09T09:20:18+11:00
draft: false
images: []
menu:
contributing:
parent: "guidelines"
weight: 320
toc: true
aliases: []
---
## Table Names
1. Should match in every database implementation.
2. Should be all lower case.
3. Should use singular form (i.e. not plural).
4. Should use the underscore character (`_`) between words.
5. Should only contain alphanumeric characters and the underscore character (`_`).
1. The underscore character (`_`):
1. Should always be used between words.
2. Should only be used:
1. Between words.
2. As a prefix for temporary tables.
2. Should start and end with only an alphabetic character, excluding specific exceptions mentioned elsewhere with
prefix and suffix terminology.
## Column Names
1. Should match in every database implementation.
2. Should be all lower case.
3. Should only contain alphanumeric characters and the underscore character (`_`).
1. The underscore character (`_`):
1. Should always be used between words.
2. Should only be used between words.
2. Should only start and end with an alphabetic character.
## Key Names
### Foreign Keys
Format: `<table_name>_<column_name>_fkey`
Where:
- The table name is the name of the table the foreign key exists on.
- The column name is the name of the column the foreign key is for.
### Unique Keys
Format: `<table_name>_<key_name>_key`
Where:
- The table name is the name of the table the unique key is on.
- The key name is the name to describe this key. This can also be the column name it exists on.
### Primary Keys
Most database engines don't allow customizing the primary key names. As such the primary key should not be explicitly
set except to change it back to the default format.

View File

@ -5,6 +5,6 @@ lead: ""
date: 2022-06-15T17:51:47+10:00
draft: false
images: []
weight: 300
weight: 900
toc: true
---

View File

@ -9,6 +9,6 @@ menu:
reference:
parent: "cli"
identifier: "cli-authelia-gen"
weight: 900
weight: 910
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 320
weight: 910
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-gen"
weight: 330
weight: 915
toc: true
---

View File

@ -9,6 +9,6 @@ menu:
reference:
parent: "cli"
identifier: "cli-authelia-scripts"
weight: 900
weight: 920
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 320
weight: 920
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia-scripts"
weight: 330
weight: 925
toc: true
---

View File

@ -9,6 +9,6 @@ menu:
reference:
parent: "cli"
identifier: "cli-authelia"
weight: 320
weight: 900
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 320
weight: 900
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

View File

@ -8,7 +8,7 @@ images: []
menu:
reference:
parent: "cli-authelia"
weight: 330
weight: 905
toc: true
---

Some files were not shown because too many files have changed in this diff Show More