mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-20 17:02:53 -04:00
This is a fresh start for the `artcraft` repo. The old monorepo, which included our web API gateway, job services, SRE tools, various frontends, and more has moved to `artcraft-services` You can find the full git history here: https://github.com/storytold/artcraft-services This change was motivated by the fact that the entire git history was hundreds of gigabytes in size, which is unwieldy for anyone not in the core team that doesn't care about support services outside of the core artcraft app. We wanted to keep this repo in its well-known place since we already have users and activity here. Please update your remotes to either `artcraft-services` or make a fresh clone of this repo. History can be found at the artcraft-services repo.
934 B
934 B
Migrations guide
Diesel Migrations
To run pending migrations, execute the following:
diesel migration run
To revert the last 3 migrations:
diesel migration revert -n 3
To reset the entire database (drop, migrate), run:
diesel database reset
Server Query Codegen
We use SQLx instead of Diesel in the production server. It's typesafe SQL instead of an ORM like Diesel.
SQLx connects to a database to derive type information, but obviously cannot do this for builds in CI. In order to cache the types, we build and check in a cache file (necessary for builds):
SQLX_OFFLINE=true cargo sqlx prepare
Now that we have multiple binaries, it's required to include all the queries in the main binary so we can generate the cached queries as a single target. That's then executed with:
SQLX_OFFLINE=true cargo sqlx prepare -- --bin storyteller-web