Browse Source

create_migrations now adds migration to Schema.cpp

main
Stefan Pranger 3 years ago
parent
commit
cc85930e69
  1. 8
      create_migration.sh

8
create_migration.sh

@ -25,7 +25,7 @@ namespace db {
EOF EOF
) )
include="#include \"migrations/$migration.h\""
map_entry="migrations.emplace($epoch, new db::migrations::m$migration());"
echo $include
echo $map_entry
include="#include \\\"migrations/$migration.h\\\""
map_entry=" migrations.emplace($epoch, new db::migrations::m$migration());"
gawk -i inplace "FNR==NR{ if (/migrations.emplace/) p=NR; next} 1; FNR==p{ print \"$map_entry\" }" db/Schema.cpp db/Schema.cpp
gawk -i inplace "FNR==NR{ if (/#include \"migrations/) p=NR; next} 1; FNR==p{ print \"$include\" }" db/Schema.cpp db/Schema.cpp
Loading…
Cancel
Save