Search code examples
node.jspostgresqlcsvserverlessdbmigrate

db-migrate insert data from csv


I need to insert data in to my postgresql via db-migrate for my serverless app. So I have 4 table and each table has it's own csv data. Due to the number of record, I need to do it automatically, any advice? thanks


Solution

  • You could:

    • create a lambda that will use db-migrate to perform whatever operation you need to do
    • install serverless-scriptable-plugin
    • invoke the function you created immediately after each deploy (by literally running serverless invoke -f yourfunction)