I’m wanting to create a single RDS cluster which t...
# sst
j
I’m wanting to create a single RDS cluster which then has multiple databases inside (one for each of my microservices) but I’m stuck at the
migrations
being a string to a path. I need to be able to know which database is targeted for migration and then set the path for the migrations accordingly. Something like this
Copy code
export async function RDSStack({ stack, app }: StackContext) {
  const cluster = new RDS(stack, "RDSCluster", {
    engine: "postgresql10.14",
    defaultDatabaseName: 'postgres',
    migrations: (dbname: string) => new FileMigrationProvider(`./migrations/${dbname}`)
  })

  return { cluster }
@Frank @thdxr is this something that could be looked at or is there way that I can tell the underlying Kysely to use a custom
MigrationProvider
class?
I also would like my migration scripts to live with the microservice its for, so I don’t have a static path I can provide. Also with what I’m proposing, I’d have a migration script for the default db which then creates each of my databases.
t
Our construct only supports applying migrations to a single DB. @Frank maybe we should think of a way to support multiple? I'd suggest for now making your own script that handles migrations
j
Right now I’m just using one RDS cluster per microservice… but because of the VPC limit, we have to create a single VPC and have them all use that. I just don’t need to have lots of clusters. So I’m able to continue moving forward but a way to handle multiple database would be better.
f