Project

General

Profile

Actions

Defect #18

closed

table_name_pre/suffix support

Added by Satoru KURASHIKI about 17 years ago. Updated about 17 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Rails supports DB table namespaces with ActiveRecord::Base.table_name_pre/suffix.
This will be valuable for some hosting services(users can use only one db).
I tried with MySQL, but it doesn't work well.

1)db:migrate works fine.
After I added this line to config/environment.rb, 'rake db:migrate' created prefixed tables correctly.
ActiveRecord::Base.table_name_prefix = 'redmine_'

2)app/models couldn't handle prefixed tables.
Almost all actions failed, because SQL sentences couldn't find coded table_names.
(ex. "news.created_on DESC" will search 'news' table, but 'redmine_news' exists)

Actions

Also available in: Atom PDF