diff --git a/backend/.sqlfluff b/backend/.sqlfluff index 6aa7b483c..b7fdc696a 100644 --- a/backend/.sqlfluff +++ b/backend/.sqlfluff @@ -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] @@ -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 diff --git a/backend/migrations/2023-07-04-190000_base_layer/up.sql b/backend/migrations/2023-07-04-190000_base_layer/up.sql index c3db15b86..b64e17ae6 100644 --- a/backend/migrations/2023-07-04-190000_base_layer/up.sql +++ b/backend/migrations/2023-07-04-190000_base_layer/up.sql @@ -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 ); diff --git a/backend/migrations/2023-07-12-143111_user_data/up.sql b/backend/migrations/2023-07-12-143111_user_data/up.sql index d07d2e6d2..9cf490b86 100644 --- a/backend/migrations/2023-07-12-143111_user_data/up.sql +++ b/backend/migrations/2023-07-12-143111_user_data/up.sql @@ -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 ); diff --git a/backend/migrations/2023-07-21-085933_gain_blossoms/up.sql b/backend/migrations/2023-07-21-085933_gain_blossoms/up.sql index b622d9f90..2feb514df 100644 --- a/backend/migrations/2023-07-21-085933_gain_blossoms/up.sql +++ b/backend/migrations/2023-07-21-085933_gain_blossoms/up.sql @@ -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) ); diff --git a/doc/changelog.md b/doc/changelog.md index f3ecf180b..ace8537f2 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -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)_ - _()_ - _()_ - _()_ diff --git a/doc/decisions/database_plant_hierarchy.md b/doc/decisions/database_plant_hierarchy.md index 8d0653cdb..cdb46ebff 100644 --- a/doc/decisions/database_plant_hierarchy.md +++ b/doc/decisions/database_plant_hierarchy.md @@ -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