Skip to content

Commit

Permalink
refactor: remove some unnecessary semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Mar 21, 2024
1 parent 4a12b3d commit 95bd131
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion migrations/2020-010_kit-memberships/down.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DROP TABLE kit_memberships;
DROP TABLE kit_memberships
3 changes: 1 addition & 2 deletions migrations/2023-09-01-125329_dont-leak-media/down.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ ALTER TABLE media
ALTER TABLE media
ADD CONSTRAINT media_peripheral_id_fkey FOREIGN KEY (peripheral_id) REFERENCES peripherals (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT media_kit_id_fkey FOREIGN KEY (kit_id) REFERENCES kits (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT media_kit_configuration_id_fkey FOREIGN KEY (kit_configuration_id) REFERENCES kit_configurations (id) ON DELETE CASCADE ON UPDATE CASCADE;

ADD CONSTRAINT media_kit_configuration_id_fkey FOREIGN KEY (kit_configuration_id) REFERENCES kit_configurations (id) ON DELETE CASCADE ON UPDATE CASCADE
3 changes: 1 addition & 2 deletions migrations/2023-09-01-125329_dont-leak-media/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ ALTER TABLE media
ALTER TABLE media
ADD CONSTRAINT media_peripheral_id_fkey FOREIGN KEY (peripheral_id) REFERENCES peripherals (id) ON DELETE RESTRICT ON UPDATE CASCADE,
ADD CONSTRAINT media_kit_id_fkey FOREIGN KEY (kit_id) REFERENCES kits (id) ON DELETE RESTRICT ON UPDATE CASCADE,
ADD CONSTRAINT media_kit_configuration_id_fkey FOREIGN KEY (kit_configuration_id) REFERENCES kit_configurations (id) ON DELETE RESTRICT ON UPDATE CASCADE;

ADD CONSTRAINT media_kit_configuration_id_fkey FOREIGN KEY (kit_configuration_id) REFERENCES kit_configurations (id) ON DELETE RESTRICT ON UPDATE CASCADE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DROP TABLE queue_media_pending_deletion;
DROP TABLE queue_media_pending_deletion
3 changes: 1 addition & 2 deletions migrations/2023-09-01-141454_add-queue-media-deletion/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ CREATE TABLE queue_media_pending_deletion (
media_id uuid NOT NULL UNIQUE,
media_datetime timestamptz NOT NULL,
media_size int8 NOT NULL,
CONSTRAINT media_size_positive CHECK ((media_size >= 0))
);
CONSTRAINT media_size_positive CHECK ((media_size >= 0)))
2 changes: 1 addition & 1 deletion migrations/2024-03-15-155708_create-kit-last-seen/down.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DROP TABLE kit_last_seen;
DROP TABLE kit_last_seen
2 changes: 1 addition & 1 deletion migrations/2024-03-15-155708_create-kit-last-seen/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ CREATE INDEX ix_kit_last_seen_datetime_last_seen ON public.kit_last_seen USING b

-- foreign keys
ALTER TABLE public.kit_last_seen
ADD CONSTRAINT kit_last_seen_kit_id_fkey FOREIGN KEY (kit_id) REFERENCES kits (id) ON DELETE CASCADE ON UPDATE CASCADE;
ADD CONSTRAINT kit_last_seen_kit_id_fkey FOREIGN KEY (kit_id) REFERENCES kits (id) ON DELETE CASCADE ON UPDATE CASCADE
3 changes: 2 additions & 1 deletion migrations/2024-03-15-161913_populate-kit-last-seen/down.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-- no-op
SELECT 1;
SELECT
1
2 changes: 1 addition & 1 deletion migrations/2024-03-15-161913_populate-kit-last-seen/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ FROM
GROUP BY
kit_id
ON CONFLICT
DO NOTHING;
DO NOTHING
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DROP TRIGGER kit_configurations_10_set_first_activated_at ON kit_configurations;
DROP FUNCTION kit_configurations_set_first_activated_at;

ALTER TABLE kit_configurations
DROP COLUMN first_activated_at;
DROP COLUMN first_activated_at
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ FROM (
kit_configuration_id) AS m
WHERE
NOT kc.never_used
AND m.kit_configuration_id = kc.id;
AND m.kit_configuration_id = kc.id
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ALTER TABLE kit_configurations
ALTER COLUMN never_used DROP EXPRESSION;
ALTER COLUMN never_used
DROP EXPRESSION
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
-- column into a generated one in pg 14
ALTER TABLE kit_configurations
DROP never_used,
ADD never_used bool NOT NULL GENERATED ALWAYS AS (first_activated_at IS NULL) STORED;
ADD never_used bool NOT NULL GENERATED ALWAYS AS (first_activated_at IS NULL) STORED
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ ALTER TABLE kits

ALTER TABLE users
DROP COLUMN updated_at,
DROP COLUMN created_at;
DROP COLUMN created_at
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ FROM (
GROUP BY
user_id) AS m
WHERE
m.user_id = id;
m.user_id = id

0 comments on commit 95bd131

Please sign in to comment.