Skip to content

Adding initial data insertion into setup script#2293

Merged
s3inlc merged 5 commits into
masterfrom
initial-data
Jul 2, 2026
Merged

Adding initial data insertion into setup script#2293
s3inlc merged 5 commits into
masterfrom
initial-data

Conversation

@s3inlc

@s3inlc s3inlc commented Jul 1, 2026

Copy link
Copy Markdown
Member

With the way migrations work with sqlx we will have trouble in the future to adjust existing sql data to changes (e.g. new hashcat version, new agent binary versions).

Due to this, we move all the initial insertion data outside of the initial sql files and insert them on the first setup steps (where also the admin user is created) on the very first start. This allows to change values later without having to create a complete new migrations generation just for changing an initial value like a version number.

What still has to be solved, is how agent binaries are upgraded for existing setups. For this there are two options how we could achieve this:

  • do it within migrations (if it is able to identify in there which object exactly to update)
  • have some other steps in the setup which do it (less favored due to more code to maintain and difficult to avoid issues)

Currently we have the initial data both in the initial sql of the current generation and also check to insert it on the setup. This is not problem, as it checks if the given IDs already exist. At a later point on the next migrations generation, we can throw out the initial data from the sql scripts.

@s3inlc s3inlc added this to the Release v1.0.0 milestone Jul 1, 2026
@s3inlc s3inlc requested a review from jessevz July 1, 2026 11:30
@s3inlc s3inlc merged commit 1dc0df4 into master Jul 2, 2026
14 checks passed
@s3inlc s3inlc deleted the initial-data branch July 2, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants