# Starting a new project

**URL:** <https://www.ruby-forum.com/t/starting-a-new-project/111624>\
**Category:** Rails\
**Created:** [August 9, 2007, 9:04am UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624 "2007-08-09T09:04:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 9, 2007, 9:04am UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/1 "2007-08-09T09:04:17Z")

</div>

When starting a new project, should I build my database in a database  
client program, or should i just use database migrations right away?

I’m new on the list btw… Hi 🙂

Christian…

---

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 9, 2007, 9:20am UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/2 "2007-08-09T09:20:19Z")

</div>

Christian Wattengård wrote:

> When starting a new project, should I build my database in a database  
> client program, or should i just use database migrations right away?

Whatever you feel most comfortable with. If you start with a non  
migration approach you can always export the schema into a migration  
later on (at least the features supported by the schema dumper).  
Personally, I always go straight into migrations.

> I’m new on the list btw… Hi 🙂

Welcome to the list.

–  
Cheers,

- Jacob A.

---

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 11, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/3 "2007-08-11T16:20:50Z")

</div>

Christian Wattengård wrote:

> When starting a new project, should I build my database in a database  
> client program, or should i just use database migrations right away?

Start with a test case that fails because a given model does not exist

Then use script/generate model foo to create the model. I suspect it  
creates  
the migration.

Then migrate with both rake db:migrate and rake RAILS\_ENV=test  
db:migrate.

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 11, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/4 "2007-08-11T16:41:56Z")

</div>

Hi –

On Thu, 9 Aug 2007, Christian Wattengård wrote:

> When starting a new project, should I build my database in a database  
> client program, or should i just use database migrations right away?

I would at least give yourself the experience of using the migrations  
from the beginning in a project, and see what you think. Migrations  
have some fragilities, but they’re kind of addictive. Just remember  
that migrations and non-migrations don’t mix. The migration system  
expects to be in pretty much complete control once it’s in use.

> I’m new on the list btw… Hi 🙂

Hi!

David

–

- Books:  
RAILS ROUTING (new! [http://www.awprofessional.com/title/0321509242](http://www.awprofessional.com/title/0321509242))  
RUBY FOR RAILS ([Ruby for Rails](http://www.manning.com/black))
- Ruby/Rails training  
& consulting: Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 11, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/5 "2007-08-11T16:38:56Z")

</div>

Hi –

On Sat, 11 Aug 2007, Phlip wrote:

> Christian Wattengård wrote:
> 
> > When starting a new project, should I build my database in a database  
> > client program, or should i just use database migrations right away?
> 
> Start with a test case that fails because a given model does not exist
> 
> Then use script/generate model foo to create the model. I suspect it creates  
> the migration.

It also creates the unit test file for the model. I’m probably  
showing my lack of TDD rigor, but I have no problem with creating a  
model, letting the framework create the relevant boilerplate files for  
me (including the test file), and then starting the process. For one  
thing, writing a failing test before generating the model is going to  
mean creating a home-made test file, which, if it’s going to fail for  
the right reasons, should be identical to the one that the framework  
creates. I don’t see any gain in doing that manually.

David

–

- Books:  
RAILS ROUTING (new! [http://www.awprofessional.com/title/0321509242](http://www.awprofessional.com/title/0321509242))  
RUBY FOR RAILS ([Ruby for Rails](http://www.manning.com/black))
- Ruby/Rails training  
& consulting: Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [August 16, 2007, 2:49pm UTC](https://www.ruby-forum.com/t/starting-a-new-project/111624/6 "2007-08-16T14:49:00Z")

</div>

On 11 Aug, 16:40, removed\_email\_address@domain.invalid wrote:

> that migrations and non-migrations don’t mix. The migration system  
> expects to be in pretty much complete control once it’s in use.

Seeing as I have no experience at all in TDD I think that I will skip  
that part 😉  
I’ll try both using migrations and the oldschool way I think. 🙂

Christian
