What type of SQL code to add here. Are only the heatmap functions planned for now?

All the FUNCTIONS/TRIGGER etc. that are not tightly connected to the tables/data.

So it is for code, data stays in the migrations.

The SQL files are saved in backend/src/sql_files and should be named import_*.sql.

When it is being run?

First suggestion:

  1. creation of database
  2. running migrations
  3. the SQL imports we discuss here
  4. importing test data+maps
  5. run e2e tests

These deps should be tested and then documented and being implemented in Makefiles and CI (if it does not simply call make) the same way.

In what format should it be? Do we also need DROP statements? Otherwise just removing a function/file leaves the functions/types in the database.

It should be idempotent, so reimporting the SQL files many times should be no problem (no errors etc.). So we need something like DROP FUNCTION IF EXISTS.