agola/internal/sqlg/manager
Simone Gotti 1aad77179c db: defer sqlite foreign keys during migration
Sqlite provides only limited alter tables capabilities, complex things
must be done by creating a new table and migrating the data. Things
becomes more complex when other tables references the table being
altered.

For doing this the documentation provides a list of steps
https://www.sqlite.org/lang_altertable.html#making_other_kinds_of_table_schema_changes
The first stable is disabling foreign keys, but this must be done
outside a transaction.

This patch adds this to the migration logic: disable foreign keys
outside transaction, check foreign keys before committing the
transaction and then re enable them outside the transaction.
2023-11-13 14:20:26 +01:00
..
create.go *: new db schema 2023-04-13 11:04:52 +02:00
export.go *: new db schema 2023-04-13 11:04:52 +02:00
import.go *: new db schema 2023-04-13 11:04:52 +02:00
manager.go db: defer sqlite foreign keys during migration 2023-11-13 14:20:26 +01:00
migrate.go db: defer sqlite foreign keys during migration 2023-11-13 14:20:26 +01:00