You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature
We want to be able to create new projects, which include all the seeded data from the fwdata template project. The template will be stored in our repo as a sql file, which when a new project is created the sql file will be applied to the database.
How the template will be created:
Create a new FW project (maybe we can open the template directly?)
Import that FW Project into a new empty crdt database (alternatively the database could be created from the previous template, and the FW project is synced in, but I'm not sure there's a benefit and it might have other problems)
delete the ProjectData row (if it was ever created)
delete all Writing systems, and Purge their commits and changes, might be easier to modify the import to just exclude writing systems
from a shell run sqlite3 .\Example-Project.sqlite ".dump" > template.sql we now have a sql file which can be applied to a database to spin it up very quickly.
Note
This could happen in CI or we could just manually run the script to update the template from time to time, I'm not sure what's best here, FieldWorks does sometimes update their template, so we would want to try and keep in sync with that.
How the template will be used when creating a new project
run cat template.sql | sqlite newProject.sql to create the database
Generate and insert a new ProjectData row
change the commit ClientId to match the client ID generated for the project data row. Something like update Commits set ClientId = 'newid', we do this so that the same ClientId isn't matched across all databases, though it's possible this is actually desirable.
do the rest of the project setup, eg create writing systems.
Describe the feature
We want to be able to create new projects, which include all the seeded data from the fwdata template project. The template will be stored in our repo as a sql file, which when a new project is created the sql file will be applied to the database.
How the template will be created:
sqlite3 .\Example-Project.sqlite ".dump" > template.sqlwe now have a sql file which can be applied to a database to spin it up very quickly.Note
This could happen in CI or we could just manually run the script to update the template from time to time, I'm not sure what's best here, FieldWorks does sometimes update their template, so we would want to try and keep in sync with that.
How the template will be used when creating a new project
cat template.sql | sqlite newProject.sqlto create the databaseupdate Commits set ClientId = 'newid', we do this so that the same ClientId isn't matched across all databases, though it's possible this is actually desirable.