테이블 명명규칙

IT(Old)/RubyOnRails-Tip 2008. 1. 21. 09:47

rails에서는

테이블명에는 복수형을(끝에 s붙임)

모델은 단수형을 사용한다.

그래야...자동으로 테이블 일대일매핑이 가능하다.

ㅡ.ㅡ

database내 테이블 목록 보기

IT(Old)/DB-Mysql 2008. 1. 21. 09:38
show tablse in database_name;

my sql DB config(database.yml)

IT(Old)/RubyOnRails-Tip 2008. 1. 21. 09:30

# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: mysql
  database: test
  username: root
  password: xxxxx
  encoding: utf8

# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: test
  username: root
  password: xxxxx
  encoding: utf8

production:
  adapter: mysql
  database: test
  username: root
  password: xxxxx
  encoding: utf8