Skip to content

Instantly share code, notes, and snippets.

View boothbarber's full-sized avatar

LAB96 boothbarber

  • LAB96
  • Chicago
  • 03:10 (UTC -12:00)
View GitHub Profile
@boothbarber
boothbarber / 066-multi-select-availability-clientele.sql
Created April 30, 2026 21:29
BOOTH migration 066: convert availability + clientele_size to TEXT[] (multi-select)
/*
066: convert barber_profiles.availability and clientele_size to TEXT[]
so barbers can pick multiple values. Drops the single-value CHECK
constraints and migrates existing rows by wrapping the current value
in an array. Also adds "walk_in_ready" as a new clientele tag.
Notes:
- existing availability values: full_time, part_time, weekdays_only,
weekends_only, flexible
- existing clientele_size values: building, established, large_following
@boothbarber
boothbarber / 065-add-weekdays-only-availability.sql
Created April 30, 2026 21:24
BOOTH migration 065: allow weekdays_only on barber_profiles.availability
/*
065: extend barber_profiles.availability CHECK constraint to include
weekdays_only. The original constraint from migration 059 only allowed
full_time / part_time / weekends_only / flexible.
*/
BEGIN;
ALTER TABLE barber_profiles
DROP CONSTRAINT IF EXISTS barber_profiles_availability_check;
@boothbarber
boothbarber / 062-network-votes-comments-per-image.sql
Created April 30, 2026 21:06
BOOTH migration 062: scope votes + comments to a specific portfolio image
/*
062: scope votes + comments to a specific portfolio image
Previously they were keyed by barber_profile_id, which meant a single
vote/comment applied to every post from that barber. Add a
portfolio_image_id FK, backfill best-effort to the barber's first image,
then enforce per-image uniqueness on votes.
*/
BEGIN;
@boothbarber
boothbarber / 064-allow-network-notification-types.sql
Created April 30, 2026 20:00
BOOTH migration 064: extend notifications.type CHECK to allow invite_to_apply / new_follower / profile_view
/*
064: extend notifications.type CHECK constraint to cover the
network/inquire flows. Earlier migrations capped the allowed
values, so inserting "invite_to_apply" (and the related
network types) currently fails with notifications_type_check.
*/
BEGIN;
ALTER TABLE notifications DROP CONSTRAINT IF EXISTS notifications_type_check;
@boothbarber
boothbarber / 063-replace-facebook-with-x-on-barber-profiles.sql
Created April 30, 2026 18:31
BOOTH migration 063: add x_url to barber_profiles
/*
063: replace facebook_url with x_url on barber_profiles
Adds a nullable x_url column. We keep facebook_url in place for now
(no destructive drop) so any existing rows survive — the app stops
reading/writing it.
*/
BEGIN;
ALTER TABLE barber_profiles