fix: dont store script in migration
This commit is contained in:
parent
2345c61b8c
commit
8b08d9f9c8
@ -2,7 +2,6 @@ create table public.migration
|
|||||||
( from_revision text not null
|
( from_revision text not null
|
||||||
, to_revision text not null
|
, to_revision text not null
|
||||||
, performed_on timestamp not null default now()
|
, 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');
|
||||||
|
@ -17,7 +17,7 @@ dnim_database_count=$(psql "$POSTGRES_URI/postgres" -c "$get_dnim_database_count
|
|||||||
if [[ "$dnim_database_count" = "0" ]]; then
|
if [[ "$dnim_database_count" = "0" ]]; then
|
||||||
echo "fresh database"
|
echo "fresh database"
|
||||||
psql "$POSTGRES_URI/postgres" -c "create database dnim;"
|
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'
|
last_revision='empty'
|
||||||
script=''
|
script=''
|
||||||
else
|
else
|
||||||
@ -34,6 +34,6 @@ else
|
|||||||
fi
|
fi
|
||||||
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"
|
psql "$POSTGRES_URI/dnim" -c "$insert_migration"
|
||||||
echo "inserted migration"
|
echo "inserted migration"
|
||||||
|
Loading…
Reference in New Issue
Block a user