Missing foreign keys SQLite #132

Closed
opened 2026-02-05 17:10:33 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @Boy132 on GitHub (Jul 12, 2024).

Originally assigned to: @Boy132 on GitHub.

The following foreign keys are missing when using SQLite:

Table name Referenced table name Constraint name Colum nname
allocations nodes allocations_node_id_foreign node_id
allocations servers allocations_server_id_foreign server_id
api_keys users api_keys_user_id_foreign user_id
databases database_hosts databases_database_host_id_foreign database_host_id
databases servers databases_server_id_foreign server_id
database_hosts nodes database_hosts_node_id_foreign node_id
eggs eggs eggs_copy_script_from_foreign copy_script_from
eggs eggs eggs_config_from_foreign config_from
egg_mount mounts egg_mount_mount_id_foreign mount_id
egg_mount eggs egg_mount_egg_id_foreign egg_id
egg_variables eggs service_variables_egg_id_foreign egg_id
mount_node nodes mount_node_node_id_foreign node_id
mount_node mounts mount_node_mount_id_foreign mount_id
mount_server servers mount_server_server_id_foreign server_id
mount_server mounts mount_server_mount_id_foreign mount_id
servers users servers_owner_id_foreign owner_id
servers nodes servers_node_id_foreign node_id
servers eggs servers_egg_id_foreign egg_id
servers allocations servers_allocation_id_foreign allocation_id
server_variables egg_variables server_variables_variable_id_foreign variable_id
server_variables servers server_variables_server_id_foreign server_id
subusers users subusers_user_id_foreign user_id
subusers servers subusers_server_id_foreign server_id

This is because you can only alter foreign keys when a table is created. The above foreign keys are created in migrations after the table is created thus they are missing.

Originally created by @Boy132 on GitHub (Jul 12, 2024). Originally assigned to: @Boy132 on GitHub. The following foreign keys are missing when using SQLite: | Table name | Referenced table name | Constraint name | Colum nname | | -------- | -------- | -------- | -------- | | allocations | nodes | allocations_node_id_foreign | node_id | | allocations | servers | allocations_server_id_foreign | server_id | | api_keys | users | api_keys_user_id_foreign | user_id | | databases | database_hosts | databases_database_host_id_foreign | database_host_id | | databases | servers | databases_server_id_foreign | server_id | | database_hosts | nodes | database_hosts_node_id_foreign | node_id | | eggs | eggs | eggs_copy_script_from_foreign | copy_script_from | | eggs | eggs | eggs_config_from_foreign | config_from | | egg_mount | mounts | egg_mount_mount_id_foreign | mount_id | | egg_mount | eggs | egg_mount_egg_id_foreign | egg_id | | egg_variables | eggs | service_variables_egg_id_foreign | egg_id | | mount_node | nodes | mount_node_node_id_foreign | node_id | | mount_node | mounts | mount_node_mount_id_foreign | mount_id | | mount_server | servers | mount_server_server_id_foreign | server_id | | mount_server | mounts | mount_server_mount_id_foreign | mount_id | | servers | users | servers_owner_id_foreign | owner_id | | servers | nodes | servers_node_id_foreign | node_id | | servers | eggs | servers_egg_id_foreign | egg_id | | servers | allocations | servers_allocation_id_foreign | allocation_id | | server_variables | egg_variables | server_variables_variable_id_foreign | variable_id | | server_variables | servers | server_variables_server_id_foreign | server_id | | subusers | users | subusers_user_id_foreign | user_id | | subusers | servers | subusers_server_id_foreign | server_id | This is because you can only alter foreign keys when a table is created. The above foreign keys are created in migrations after the table is created thus they are missing.
OVERLORD added the 🟡 medium label 2026-02-05 17:10:33 +03:00
Author
Owner

@rmartinoscar commented on GitHub (Jul 12, 2024):

So should we use a schema for sqlite aswell then ?

@rmartinoscar commented on GitHub (Jul 12, 2024): So should we use a schema for sqlite aswell then ?
Author
Owner

@notAreYouScared commented on GitHub (Jul 12, 2024):

So should we use a schema for sqlite aswell then ?

This would require the end user to install the sqlite client packages, somthing were trying to avoid. But might not be an option.

@notAreYouScared commented on GitHub (Jul 12, 2024): > So should we use a schema for sqlite aswell then ? This would require the end user to install the sqlite client packages, somthing were trying to avoid. But might not be an option.
Author
Owner

@rmartinoscar commented on GitHub (Jul 12, 2024):

So should we use a schema for sqlite aswell then ?

This would require the end user to install the sqlite client packages, somthing were trying to avoid. But might not be an option.

You did it anyway for mysql/mariadb why bother with sqlite3 ?
If i want to use either of them i must install the client even if the instance is on an other machine.

@rmartinoscar commented on GitHub (Jul 12, 2024): > > So should we use a schema for sqlite aswell then ? > > This would require the end user to install the sqlite client packages, somthing were trying to avoid. But might not be an option. You did it anyway for mysql/mariadb why bother with sqlite3 ? If i want to use either of them i must install the client even if the instance is on an other machine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel-pelican-dev#132