Re:PostgreSQL IDE in VS Code
by cerved on Friday May 23, 2025 @07:25PM
(#44077518)
I'm more confused why the version control of the thing using the database is including the entire schema of the database in it's repository
[ Parent
| on HN ]
It makes it trivial to have pretty diffs of the net result of migrations.
Re:PostgreSQL IDE in VS Code
by schrodinger on Friday May 23, 2025 @10:27PM
(#44078300)
The database schema of an app is tightly coupled enough to essentially be code, and migrations are also probably checked in. This lets you see how the db schema changes over time -- likely along with the queries using the schema.
This is only true when your app is the only thing that is using the database. In enterprise environments, databases are frequently shared between many different apps.
Sure, and in those cases you'd typically have a dedicated repository storing said schema and migrations.
It's important to manage your schema in code for various reasons from change control to standing up development databases, etc.