add migrations

This commit is contained in:
2024-04-25 22:26:57 +02:00
parent 98d5539fdd
commit 5964a1ddad
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
-- Add migration script here
CREATE TABLE IF NOT EXISTS LINKS(
UUID TEXT NOT NULL PRIMARY KEY,
DESTINATION TEXT NOT NULL
);

View File

@@ -292,6 +292,10 @@ async fn main() -> std::io::Result<()> {
.await
.expect("could not create db pool");
sqlx::migrate!("./migrations")
.run(&db_pool)
.await.unwrap();
println!(
"Listening on: {}://{}, open browser and visit have a try!",
protocol, base_url