Not clear what happens during migrate

I have a sandbox project and have properly created a migrate that created the initial schema, and applied it. Then I added a column to my schema.ts and generated the migration again, making a 0002 sql file. Then when applying that, the schema doesn't upgrade. I only have two ways to see what happened, the console says:
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '132',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
Migration completed
migration finished
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '132',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
Migration completed
migration finished
And then I check my drizzle __drizzle_migrations table, which has one row:
id, hash, created_at
1, '2e6f4a3d09b418f5896f27e7a441245a88e51d9616d6d5ad7afca4739701a688', 1714060886856
id, hash, created_at
1, '2e6f4a3d09b418f5896f27e7a441245a88e51d9616d6d5ad7afca4739701a688', 1714060886856
Is there a way I can troubleshoot why the migration doesn't appear to have been applied, and what SQL statements and/or files or running, or any type of logging beyond what's above?
3 Replies
'antonyyprints'
'antonyyprints'3mo ago
any chance you found an answer elsewhere?
Peit
Peit3mo ago
not sure it is the reason the migration is not running, but check the journal.json for the when value. that correlates to the created_at in drizzle_migrations table, and wont run if smaller than existing
Angelelz
Angelelz3mo ago
Can you show the generated migration file after the second schema change?