With the migrations for RDS databases, if I create...
# sst
j
With the migrations for RDS databases, if I create multiple database, how do the migrations know which database to run them against?
Is it just that I keep the scripts for each DB separate?
Copy code
new sst.RDS(this, "CustomersDb", {
            engine: "postgresql10.14",
            defaultDatabaseName: "Customers",
            migrations: "scripts/migrations/customers",
        })

        new sst.RDS(this, "FulfillmentDb", {
            engine: "postgresql10.14",
            defaultDatabaseName: "Fulfillment",
            migrations: "scripts/migrations/fulfillment",
        })
t
we pass in the right DB when executing the script
each cluster gets its own lambda function that runs migrations
f
@jamlen by “multiple database” you mean multiple
RDS
constructs like the snippet above right?
j
@Frank yes, each of our stacks are having their own RDS DB
f
I see.. b/c each RDS construct can contain multiple databases. Just wanted to clarify it.
So yeah, if u have multiple RDS constructs, each get their own
migrations
lambda function
j
@Frank do the migration files have to be in js format? I'm getting
Copy code
ERROR TypeError: Unknown file extension ".ts" for ~/dev/src/github.com/jamlen/demo/backend/scripts/migrations/customers/00001-init-customers.ts
Its not very clear in the docs
t
yeah we currently require them to be in js, have ideas for supporting ts but not implemented yet