mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
fix(migrations): a fresh PostgreSQL database migrates, and CI tests it
The first appsettings migrations insert the default rows with fixed ids, which a PostgreSQL id sequence does not see; the login lockout migration, the first to insert without an id, then collided with id 1. It now moves the sequence past the existing rows first (a no-op on sqlite), which also covers a database upgraded from any earlier migration. A test compute password exceeded its 14-character column, which only PostgreSQL enforces.
This commit is contained in:
parent
85706c5df6
commit
f889861e18
4 changed files with 63 additions and 3 deletions
27
.github/workflows/test.yml
vendored
27
.github/workflows/test.yml
vendored
|
|
@ -12,12 +12,37 @@ permissions:
|
|||
|
||||
jobs:
|
||||
test:
|
||||
name: Python ${{ matrix.python-version }}
|
||||
name: Python ${{ matrix.python-version }} / ${{ matrix.database }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
database: [sqlite]
|
||||
include:
|
||||
- python-version: '3.12'
|
||||
database: postgresql
|
||||
|
||||
# Used by the postgresql leg only; settings fall back to sqlite when
|
||||
# WEBVIRTCLOUD_DB_HOST is empty.
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_USER: webvirtcloud
|
||||
POSTGRES_PASSWORD: webvirtcloud
|
||||
POSTGRES_DB: webvirtcloud
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 10
|
||||
|
||||
env:
|
||||
WEBVIRTCLOUD_DB_HOST: ${{ matrix.database == 'postgresql' && 'localhost' || '' }}
|
||||
WEBVIRTCLOUD_DB_PASSWORD: webvirtcloud
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue