Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Fix sqlfluff config, fix .sql files
Browse files Browse the repository at this point in the history
  • Loading branch information
4ydan committed Aug 23, 2023
1 parent 6b46dbe commit e2feeea
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 33 deletions.
5 changes: 3 additions & 2 deletions backend/.sqlfluff
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# https://docs.sqlfluff.com/en/stable/configuration.html
[sqlfluff]
dialect = postgres
max_line_length = 120

#enforce upper and lowercase
# Capitalization Rules
[sqlfluff:rules:capitalisation.keywords]
capitalisation_policy = upper
[sqlfluff:rules:capitalisation.identifiers]
Expand All @@ -12,4 +13,4 @@ extended_capitalisation_policy = lower
[sqlfluff:rules:capitalisation.literals]
capitalisation_policy = lower
[sqlfluff:rules:capitalisation.types]
extended_capitalisation_policy = upper
extended_capitalisation_policy = lower
10 changes: 5 additions & 5 deletions backend/migrations/2023-07-04-190000_base_layer/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
-- Please create a new migration instead.

CREATE TABLE base_layer_images (
id UUID PRIMARY KEY,
layer_id INTEGER NOT NULL,
path TEXT NOT NULL,
rotation REAL NOT NULL,
scale REAL NOT NULL,
id uuid PRIMARY KEY,
layer_id integer NOT NULL,
path text NOT NULL,
rotation real NOT NULL,
scale real NOT NULL,
FOREIGN KEY (layer_id) REFERENCES layers (id) ON DELETE CASCADE
);
24 changes: 12 additions & 12 deletions backend/migrations/2023-07-12-143111_user_data/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ CREATE TYPE membership AS ENUM (
);

CREATE TABLE users (
id UUID PRIMARY KEY,
salutation SALUTATION NOT NULL,
title TEXT,
country TEXT NOT NULL,
phone TEXT,
website TEXT,
organization TEXT,
experience EXPERIENCE,
membership MEMBERSHIP,
member_years INTEGER ARRAY,
member_since DATE,
permacoins INTEGER ARRAY
id uuid PRIMARY KEY,
salutation salutation NOT NULL,
title text,
country text NOT NULL,
phone text,
website text,
organization text,
experience experience,
membership membership,
member_years integer ARRAY,
member_since date,
permacoins integer ARRAY
);
22 changes: 11 additions & 11 deletions backend/migrations/2023-07-21-085933_gain_blossoms/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ CREATE TYPE track AS ENUM (
);

CREATE TABLE guided_tours (
user_id UUID PRIMARY KEY,
editor_tour_completed BOOLEAN NOT NULL DEFAULT false
user_id uuid PRIMARY KEY,
editor_tour_completed boolean NOT NULL DEFAULT false
);

CREATE TABLE blossoms (
title TEXT PRIMARY KEY,
description TEXT,
track TRACK,
icon TEXT,
is_seasonal BOOLEAN NOT NULL
title text PRIMARY KEY,
description text,
track track,
icon text,
is_seasonal boolean NOT NULL
);

CREATE TABLE gained_blossoms (
user_id UUID NOT NULL,
blossom TEXT NOT NULL,
times_gained INTEGER NOT NULL,
gained_date DATE NOT NULL,
user_id uuid NOT NULL,
blossom text NOT NULL,
times_gained integer NOT NULL,
gained_date date NOT NULL,
PRIMARY KEY (user_id, blossom)
);
2 changes: 1 addition & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Syntax: `- short text describing the change _(Your Name)_`
- _()_
- _()_
- update `doc/database/hierarchy.md` to clarify how we render plant names _(temmey)_
- _()_
- updated sqlfluff config, remove unused .sql files _(temmey)_
- _()_
- _()_
- _()_
Expand Down
4 changes: 2 additions & 2 deletions doc/decisions/database_plant_hierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Cons:
- We add "cultivar" as lowest rank.
- We remove the rank "subfamily".

For details on the schema see this [example SQL](example_migrations/normalized-plants-and-ranks/2023-04-07-130215_plant_relationships/up.sql)
Here are some [example queries](example_migrations/normalized-plants-and-ranks/example_queries.sql)
For details on the schema see this [example SQL](example_migrations/normalized-plants-and-ranks/2023-04-07-130215_plant_relationships/up.sql.md)
Here are some [example queries](example_migrations/normalized-plants-and-ranks/example_queries.sql.md)

## Rationale

Expand Down

0 comments on commit e2feeea

Please sign in to comment.