-4

what is the best practice when creating a database schema for the first time? Do I need to write schema migrations, or create it from the DBMS tools?

1
  • 1
    Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask Commented Aug 25, 2021 at 8:21

1 Answer 1

2

Of course this depends a bit on your actual needs, but in general, automated and reproducible processes should be preferred over manual processes.

If you do a manual install, you will want to document it accurately so a coworker (or your future self) is able to execute it exactly, but then you might as well put that effort into an automated setup using your database framework's migration mechanism.

2
  • " reproducible processes should be preferred over manual processes." I liked that one. For the first time can't someone use the dump file of the database ? I mean that even if you have a dump file or a sequence of migration commands imbedded in a script, it will still make the process of installation automatic. So why use migration over just a simple dump file? Commented Aug 25, 2021 at 8:45
  • 1
    Using a dump file is indeed also a reproducible way of initializing the database, but depending on the dump file format (binary?) it might not mix well with source code version control. It also introduces a difference between the initial schema definition and later schema definition updates, with may not be a real problem but has a slight smell :-) Commented Aug 25, 2021 at 9:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.