Skip to content

Commit 09e3210

Browse files
authored
Add pgflow prefix to migration names (#87)
* chore: update migration script and related files for consistency and naming conventions - Modified SQL file header to correct version reference - Updated migration script to prepend 'pgflow_' to migration names and prevent duplicates - Renamed migration files for clarity and version tracking - Adjusted checksum file to reflect new migration filename - Ensured migration process enforces naming standards and improves maintainability * chore: add changeset for initial migration renaming
1 parent fa757d6 commit 09e3210

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.changeset/brown-nails-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pgflow/core': patch
3+
---
4+
5+
Change name of initial migration :-(

pkgs/core/schemas/0080_function_read_with_poll.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-- It is required because it fixes a bug with high CPU usage and Supabase --
66
-- is still using version 1.4.4. --
77
-- --
8-
-- It is slightly modified (removed headers which are not available in 1.4.1) --
8+
-- It is slightly modified (removed headers which are not available in 1.4.4) --
99
-- --
1010
-- This will be removed once Supabase upgrades to 1.5.0 or higher. --
1111
--------------------------------------------------------------------------------

pkgs/core/scripts/atlas-migrate-diff

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ if [ $# -eq 0 ]; then
77
exit 1
88
fi
99

10-
# Use the provided migration name
11-
migration_name=$1
10+
# Check if the migration name already contains "pgflow"
11+
if [[ "$1" == *"pgflow"* ]]; then
12+
echo "Error: Migration name should not contain 'pgflow' as it will be automatically prefixed"
13+
echo "Usage: $0 <migration_name>"
14+
exit 1
15+
fi
16+
17+
# Prefix the provided migration name with "pgflow_"
18+
migration_name="pgflow_$1"
1219

20+
echo "Creating migration: $migration_name"
1321
atlas migrate diff "$migration_name" --env local
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
h1:K1RLInVkCtiaVyI3W1q+ake8rrs9PzL7jVo5/eTNdjQ=
2-
20250427211121_initial.sql h1:lHho+0Pqj4zRvLpC6RrxzrvRo+fsfmSgYBzd5S0yegc=
1+
h1:R7uzzBVhNw1t0rtGkhEKiZVdP5yfqfxpadpYtFSAmAE=
2+
20250429064120_pgflow_initial.sql h1:5BnnnvlNNyRWMzmqOsAUJpp4wLSfVIgUoAtjaQT6E0Y=

0 commit comments

Comments
 (0)