add real sqlx migrations
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
DROP TABLE anmeldung;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- Add up migration script here
|
||||||
|
CREATE TABLE IF NOT EXISTS anmeldungen (
|
||||||
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
email TEXT NOT NULL,
|
||||||
|
klasse TEXT NOT NULL
|
||||||
|
);
|
||||||
-12
@@ -29,18 +29,6 @@ async fn main() {
|
|||||||
.await
|
.await
|
||||||
.expect("Failed to connect to the database.");
|
.expect("Failed to connect to the database.");
|
||||||
|
|
||||||
sqlx::query!(
|
|
||||||
"CREATE TABLE IF NOT EXISTS anmeldungen (
|
|
||||||
id INTEGER PRIMARY KEY NOT NULL,
|
|
||||||
name TEXT NOT NULL,
|
|
||||||
email TEXT NOT NULL,
|
|
||||||
klasse TEXT NOT NULL
|
|
||||||
)"
|
|
||||||
)
|
|
||||||
.execute(&db_pool)
|
|
||||||
.await
|
|
||||||
.expect("Failed to create the table.");
|
|
||||||
|
|
||||||
// build our application with some routes
|
// build our application with some routes
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.nest_service("/static", ServeDir::new("static"))
|
.nest_service("/static", ServeDir::new("static"))
|
||||||
|
|||||||
Reference in New Issue
Block a user