add real sqlx migrations
This commit is contained in:
parent
e372769477
commit
779379f32d
|
@ -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
src/main.rs
12
src/main.rs
|
@ -29,18 +29,6 @@ async fn main() {
|
|||
.await
|
||||
.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
|
||||
let app = Router::new()
|
||||
.nest_service("/static", ServeDir::new("static"))
|
||||
|
|
Loading…
Reference in New Issue