fix: dont store script in migration
All checks were successful
migrate-devel / migrate-devel (push) Successful in 7s
migrate-stage / migrate-stage (push) Successful in 7s

This commit is contained in:
Orion Kindel 2023-07-15 18:47:00 -04:00
parent 2345c61b8c
commit 8b08d9f9c8
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@ create table public.migration
( from_revision text not null
, to_revision text not null
, performed_on timestamp not null default now()
, script text not null
);
insert into migration (from_revision, to_revision, script) values ('empty', 'empty', '');
insert into migration (from_revision, to_revision) values ('empty', 'empty');

View File

@ -17,7 +17,7 @@ dnim_database_count=$(psql "$POSTGRES_URI/postgres" -c "$get_dnim_database_count
if [[ "$dnim_database_count" = "0" ]]; then
echo "fresh database"
psql "$POSTGRES_URI/postgres" -c "create database dnim;"
ls ./schema/ | xargs -I{} psql --quiet "$POSTGRES_URI/dnim" --file=./schema/{} 1>/dev/null
ls ./schema/ | xargs -I{} psql --quiet "$POSTGRES_URI/dnim" --file=./schema/{}
last_revision='empty'
script=''
else
@ -34,6 +34,6 @@ else
fi
fi
insert_migration="insert into migration (from_revision, to_revision, script) values ('$last_revision', '$to_tag', \$migration\$$script\$migration\$);"
insert_migration="insert into migration (from_revision, to_revision) values ('$last_revision', '$to_tag');"
psql "$POSTGRES_URI/dnim" -c "$insert_migration"
echo "inserted migration"