Update sqlite to postgres migration (#771)

This commit is contained in:
Bethuel Mmbaga
2026-05-29 11:38:31 +03:00
committed by GitHub
parent f022842ef3
commit 9e09fa68fa
@@ -71,7 +71,10 @@ CAST
column accounts.settings_routing_peer_dns_resolution_enabled to boolean, column accounts.settings_routing_peer_dns_resolution_enabled to boolean,
column accounts.settings_extra_peer_approval_enabled to boolean, column accounts.settings_extra_peer_approval_enabled to boolean,
column accounts.settings_extra_user_approval_required to boolean, column accounts.settings_extra_user_approval_required to boolean,
column accounts.settings_lazy_connection_enabled to boolean column accounts.settings_lazy_connection_enabled to boolean,
column accounts.settings_peer_expose_enabled to boolean,
column accounts.settings_auto_update_always to boolean,
column accounts.settings_local_mfa_enabled to boolean
; ;
``` ```
@@ -95,7 +98,7 @@ server:
store: store:
engine: "postgres" engine: "postgres"
dsn: "host=postgres-server user=postgres password=password dbname=postgres port=5432" dsn: "host=postgres-server user=postgres password=password dbname=postgres port=5432 sslmode=disable"
``` ```
Alternatively, you can pass the connection string as an environment variable instead of putting it in the config file: Alternatively, you can pass the connection string as an environment variable instead of putting it in the config file:
@@ -103,7 +106,7 @@ Alternatively, you can pass the connection string as an environment variable ins
```yaml ```yaml
netbird-server: netbird-server:
environment: environment:
- NETBIRD_STORE_ENGINE_POSTGRES_DSN=host=postgres-server user=postgres password=password dbname=postgres port=5432 - NETBIRD_STORE_ENGINE_POSTGRES_DSN=host=postgres-server user=postgres password=password dbname=postgres port=5432 sslmode=disable
``` ```
## Restart and Verify ## Restart and Verify
@@ -145,12 +148,16 @@ LOAD DATABASE
WITH include drop, create tables, create indexes, reset sequences WITH include drop, create tables, create indexes, reset sequences
CAST CAST
type blob to bytea drop default using byte-vector-to-bytea,
column client.public to boolean, column client.public to boolean,
column auth_request.force_approval_prompt to boolean, column auth_request.force_approval_prompt to boolean,
column auth_request.logged_in to boolean, column auth_request.logged_in to boolean,
column auth_request.claims_email_verified to boolean, column auth_request.claims_email_verified to boolean,
column auth_code.claims_email_verified to boolean, column auth_code.claims_email_verified to boolean,
column refresh_token.claims_email_verified to boolean column refresh_token.claims_email_verified to boolean,
column auth_request.mfa_validated to boolean,
column password.email_verified to boolean,
column user_identity.claims_email_verified to boolean
; ;
``` ```