diff --git a/Makefile b/Makefile index 820f893..5d8c22e 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,10 @@ sh: @ docker exec -it fej sh .PHONY: sh +# Starts a psql session in the database container +dbsh: + @ docker exec -it fej_db psql -U fej -d fej + # Builds the debug version, and runs the tests (but doesn't detach). test: @ ./build -m dev -a run -l -- test --no-fail-fast diff --git a/migrations/2021-04-15-155511_ivago_search/down.sql b/migrations/2021-04-15-155511_ivago_search/down.sql new file mode 100644 index 0000000..9d9d004 --- /dev/null +++ b/migrations/2021-04-15-155511_ivago_search/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +DROP SCHEMA ivago CASCADE; diff --git a/migrations/2021-04-15-155511_ivago_search/up.sql b/migrations/2021-04-15-155511_ivago_search/up.sql new file mode 100644 index 0000000..f33eff1 --- /dev/null +++ b/migrations/2021-04-15-155511_ivago_search/up.sql @@ -0,0 +1,9 @@ +-- Your SQL goes here +CREATE SCHEMA ivago; + +CREATE TABLE ivago.streets ( + name TEXT NOT NULL, + city TEXT NOT NULL, + + PRIMARY KEY (name, city) +); diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..e69de29