Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot initialize fido sqlite db #647

Open
yih-redhat opened this issue Mar 15, 2024 · 1 comment
Open

cannot initialize fido sqlite db #647

yih-redhat opened this issue Mar 15, 2024 · 1 comment

Comments

@yih-redhat
Copy link

yih-redhat commented Mar 15, 2024

In the HOWTO.md, there are commands to initialize sqlite db, like:

cargo install --force diesel_cli --no-default-features --features sqlite
diesel migration run --migration-dir /usr/share/doc/fdo/migrations/migrations_manufacturing_server_sqlite --database-url "${manufacturer_db_file}"
diesel migration run --migration-dir /usr/share/doc/fdo/migrations/migrations_owner_onboarding_server_sqlite --database-url "${owner_db_file}"
diesel migration run --migration-dir /usr/share/doc/fdo/migrations/migrations_rendezvous_server_sqlite --database-url "${rendezvous_db_file}"

After I run these commands, the table is not created, I need to manually create them, like:

tee "create_table.sql" > /dev/null << EOF
CREATE TABLE manufacturer_vouchers (
    guid varchar(36) NOT NULL PRIMARY KEY,
    contents blob NOT NULL,
    ttl bigint
);
EOF
sqlite3 "${manufacturer_db_file}" < create_table.sql

I suppose this "diesel migration" command should create the table, as this is the only command provided to initialize db in HOWTO.md.

@7flying
Copy link
Contributor

7flying commented Mar 19, 2024

When you are using the RPMs we only install the sql files, and you need to run those to generate the DB. If you use the project from source you can use the diesel tool, basically diesel needs named migration dirs which we do not ship in the RPM

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

No branches or pull requests

2 participants