From 8b784aec938503fdf7d37feff457d2c16f01fb30 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 25 Dec 2021 10:42:36 +0100 Subject: [PATCH] Added index --- Cargo.toml | 2 +- docker-compose.yml | 8 ++++++++ migrations/2021-09-13-143540_sections/down.sql | 1 + migrations/2021-09-13-143540_sections/up.sql | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 70ed1df..2087071 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rb = { git = "https://git.hackbever.be/rusty-bever/common-rs.git" } +rb = { git = "https://git.rustybever.be/rusty-bever/common-rs.git" } # Backend web framework rocket = { version = "0.5.0-rc.1", features = [ "json", "uuid" ] } # Used to provide Rocket routes with database connections diff --git a/docker-compose.yml b/docker-compose.yml index 5fc94bb..fd28363 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,15 @@ services: image: 'postgres:14-alpine' restart: 'always' + healthcheck: + test: pg_isready + interval: 30s + timeout: 5s + retries: 3 + start_period: 15s + environment: + - 'POSTGRES_DB=rb' - 'POSTGRES_USER=rb' - 'POSTGRES_PASSWORD=rb' ports: diff --git a/migrations/2021-09-13-143540_sections/down.sql b/migrations/2021-09-13-143540_sections/down.sql index bd985fd..e979568 100644 --- a/migrations/2021-09-13-143540_sections/down.sql +++ b/migrations/2021-09-13-143540_sections/down.sql @@ -2,6 +2,7 @@ drop trigger insert_enforce_version_titles on versions; drop trigger update_enforce_version_titles on versions; drop function enforce_version_titles; +drop index sections_shortname_index; drop table versions cascade; drop table posts cascade; diff --git a/migrations/2021-09-13-143540_sections/up.sql b/migrations/2021-09-13-143540_sections/up.sql index c663de4..a5745b3 100644 --- a/migrations/2021-09-13-143540_sections/up.sql +++ b/migrations/2021-09-13-143540_sections/up.sql @@ -15,6 +15,8 @@ create table sections ( is_private boolean NOT NULL DEFAULT false ); +create index sections_shortname_index on sections(shortname); + create table posts ( id uuid DEFAULT gen_random_uuid() PRIMARY KEY,