# Database setup \> a good startingpoint?

**URL:** <https://www.ruby-forum.com/t/database-setup-a-good-startingpoint/130510>\
**Category:** Rails\
**Created:** [February 28, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/database-setup-a-good-startingpoint/130510 "2008-02-28T21:41:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [February 28, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/database-setup-a-good-startingpoint/130510/1 "2008-02-28T21:41:27Z")

</div>

Hi,

I am a newbie to RoR, so i hope for that someone can reply with some  
anwsers or url’s for futher reading.

My new project is to develop a travel-guide with some web 2.0 features.  
I was just wondering how my database-schema must look like…i just want  
to start basic…

Basic concept.

> **[Website Domain Names, Online Stores & Hosting](https://www.domain.com/)**
>
> Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.

[domain.com/europe/](http://domain.com/europe/)  
[domain.com/europe/netherlands/amsterdam](http://domain.com/europe/netherlands/amsterdam)  
[domain.com/europe/netherlands/amsterdam/hotels](http://domain.com/europe/netherlands/amsterdam/hotels)  
[domain.com/europe/netherlands/amsterdam/things-to-do](http://domain.com/europe/netherlands/amsterdam/things-to-do)  
[domain.com/europe/netherlands/amsterdam/restaurants](http://domain.com/europe/netherlands/amsterdam/restaurants)  
[domain.com/europe/belgium/brussel](http://domain.com/europe/belgium/brussel)  
ect

[domain.com/north-america/](http://domain.com/north-america/)  
[domain.com/north-america/united-states/new-york/hotels](http://domain.com/north-america/united-states/new-york/hotels)  
[domain.com/north-america/united-states/los-angeles](http://domain.com/north-america/united-states/los-angeles)

[domain.com/south-america/](http://domain.com/south-america/)  
[domain.com/south-america/brazil/los-angeles](http://domain.com/south-america/brazil/los-angeles)  
ect…

Each continent, country, city, hotels ect has is one page…with content

What is a good startingpoint??

Grtz…remco

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [February 29, 2008, 4:07am UTC](https://www.ruby-forum.com/t/database-setup-a-good-startingpoint/130510/2 "2008-02-29T04:07:40Z")

</div>

Remco S. wrote:

> Each continent, country, city, hotels ect has is one page…with content
> 
> What is a good startingpoint??
> 
> Grtz…remco

Work backwards from your problem domain

script/generate model Continent  
script/generate model City  
(etc… I think you can do them all in one line but I always do my models  
by hand)

class Continent \< ActiveRecord::Base  
has\_many :countries  
end

class Country \< ActiveRecord::Base  
has\_many :cities  
belongs\_to :continent  
end

etc…

meanwhile, back on the farm: db/migration/001\_create\_countries.rb  
def self\_up  
create\_table :continents do |t|  
t.column :name  
t.column :number\_of\_shark\_species\_in\_coastal\_areas  
end

etc…

that should get you started…

hth

ilan
