What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

I know they used their own ORM (dapper). However, did their manually update the database for each corresponding change? Did they use a database first or a model first approach?

What I meant by manual update of the database is that there are some web developers that change their domain model during development (e.g., add an email property to the "User" class); then they add a column in the "User" table in the database to reflect this. I know that there are frameworks that handle the database changes automatically. However, since Stack Exchange software uses dapper, I was wondering how the programmers approached this in this case.

share|improve this question

migrated from stackoverflow.com Jul 30 '11 at 18:41

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Honestly not sure if this is best on SO or MSO, but if you really want to know, our usual process would be database first:

  • add any new column as nullable
  • the db / app changes are deployed roughly at the same time, DB first; the nullable nature means that no inserts will fail in the time between DB deployment and app deployment. The time between the two will be between minutes and maybe an hour
  • backfill any data if needed (this could be part of the DB deployment on separate)
  • maybe later make it non-nullable if this is reliable

Obviously any specific scenario may require deviation from this.

The choice of ORM is unrelated here; I suspect the same approach would apply either way. As it happens we use a mix of dapper and LINQ-to-SQL. I personally find the DBML designer gets a bit messy after the fact, so I typically edit the DBML by hand rather than using the designer. This then updates the object model shared between L2S and dappper.

share|improve this answer
    
While on the subject, and you're around, there's dbase trouble right now. The questions/tagged/whatever pages are not updating for the past hour. Happened before. –  Uphill Luge Jul 30 '11 at 21:33
    
@Hans can't repro - ? example ? –  Marc Gravell Jul 30 '11 at 22:27
    
It got fixed by somebody. You could look at stackoverflow.com/questions/tagged/c%23 and note the one hour gap. Never mind. –  Uphill Luge Jul 30 '11 at 22:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .