tenseleyflow/shithub / 2626b2a

Browse files

migrations/0076: raise profile_pins position cap to 100 for Pro

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
2626b2a7ad499c83152a44e2d81d12776d65ec7c
Parents
51c53f8
Tree
968ac95

1 changed file

StatusFile+-
A internal/migrationsfs/migrations/0076_profile_pins_pro_cap.sql 21 0
internal/migrationsfs/migrations/0076_profile_pins_pro_cap.sqladded
@@ -0,0 +1,21 @@
1
+-- SPDX-License-Identifier: AGPL-3.0-or-later
2
+--
3
+-- PRO07: raise the profile_pins position cap from 6 to 100 so Pro
4
+-- users can pin more than the Free baseline. The cap stays small —
5
+-- 100 is "effectively unlimited for product copy, bounded for DB
6
+-- sanity" per PRO01. The Free cap stays at entitlements.FreeProfilePinsCap;
7
+-- enforcement lives in the handler (selectedProfilePinIDs + the per-
8
+-- feature enforce flag), this migration only relaxes the table
9
+-- constraint that backed the pre-PRO07 single cap.
10
+
11
+-- +goose Up
12
+ALTER TABLE profile_pins
13
+    DROP CONSTRAINT profile_pins_position_range;
14
+ALTER TABLE profile_pins
15
+    ADD CONSTRAINT profile_pins_position_range CHECK (position BETWEEN 1 AND 100);
16
+
17
+-- +goose Down
18
+ALTER TABLE profile_pins
19
+    DROP CONSTRAINT profile_pins_position_range;
20
+ALTER TABLE profile_pins
21
+    ADD CONSTRAINT profile_pins_position_range CHECK (position BETWEEN 1 AND 6);