only first db migration runs

thought I'd repost here in case someone else is experiencing this https://github.com/drizzle-team/drizzle-orm/issues/1017
GitHub
only first migration runs · Issue #1017 · drizzle-team/drizzle-orm
debugging step by step, I found the comparison here: drizzle-orm/drizzle-orm/src/pg-core/dialect.ts Line 65 in 5b01a4f || Number(lastDbMigration.created_at) < migration.folderMillis stops workin...
8 Replies
Andrii Sherman
Andrii Sherman15mo ago
What driver are you using?
beneidel
beneidelOP15mo ago
aws-data-api pg
ts
import { RDSDataClient } from '@aws-sdk/client-rds-data';
import { drizzle } from 'drizzle-orm/aws-data-api/pg';
import { migrate as migratePostgres } from 'drizzle-orm/aws-data-api/pg/migrator';
import { RDS } from 'sst/node/rds';

const rdsClient = new RDSDataClient({});

export const db = drizzle(rdsClient, {
database: RDS.Cluster.defaultDatabaseName,
secretArn: RDS.Cluster.secretArn,
resourceArn: RDS.Cluster.clusterArn,
logger: true,
});

export const migrate = async (path: string) => {
console.log('running migrations...');
await migratePostgres(db, { migrationsFolder: path });
console.log('migrations done.');
};
ts
import { RDSDataClient } from '@aws-sdk/client-rds-data';
import { drizzle } from 'drizzle-orm/aws-data-api/pg';
import { migrate as migratePostgres } from 'drizzle-orm/aws-data-api/pg/migrator';
import { RDS } from 'sst/node/rds';

const rdsClient = new RDSDataClient({});

export const db = drizzle(rdsClient, {
database: RDS.Cluster.defaultDatabaseName,
secretArn: RDS.Cluster.secretArn,
resourceArn: RDS.Cluster.clusterArn,
logger: true,
});

export const migrate = async (path: string) => {
console.log('running migrations...');
await migratePostgres(db, { migrationsFolder: path });
console.log('migrations done.');
};
drizzle-orm version 0.27.2
beneidel
beneidelOP15mo ago
any workarounds? or a way I can help?
Mohammed Anas
Mohammed Anas15mo ago
for dev i used to run my migrations manually on RDS sst console one suggested to drop your drizzle version . i've nt tried it but might work for you
beneidel
beneidelOP15mo ago
thanks, which version worked for you?
beneidel
beneidelOP15mo ago
oh thanks this is def a duplicate of that, thanks 👍 fixed on last version ❤️
Want results from more Discord servers?
Add your server