List Info

Thread: How to change the default naming schema for indeces in the 'session' table?




How to change the default naming schema for indeces in the 'session' table?
country flaguser name
United States
2007-09-27 08:06:48
Hi all

I'm using rails on a legacy environment with Oracle 10g. Now
I want to
move to the database based session store. BUT I'm running
into a
problem:

a) I'm using rails table_name prefixes:
  config.active_record.table_name_prefix =
"c2003_tv_"

b) It seems that during the migration rails automatically
wants to
create a index on the session_id column, which it can't:
== Session: migrating
=========================================================
-- create_table(:session)
   -> 0.0269s
-- add_index(:session, :session_id)
rake aborted!
OCIError: ORA-00972: identifier is too long: CREATE  INDEX
index_c2003_tv_session_on_session_id ON c2003_tv_session
(session_id)


How can I change the default naming schema for indeces on
the
'session' table? Or any other suggestion?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---


Re: How to change the default naming schema for indeces in the 'session' table?
country flaguser name
United States
2007-09-30 13:08:50
Just out of curiosity, can you post up your migration file?

/Jason


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---


Re: How to change the default naming schema for indeces in the 'session' table?
country flaguser name
United States
2007-10-06 09:52:24
Hi Jason

Do you mean

a) the whole migration schema from schema.rb?
b) the session migration class?

if b) it' just the regular migration created by: rake
db:sessions:create

class AddSessions < ActiveRecord::Migration
  def self.up
    create_table :sessions do |t|
      t.column :session_id, :string
      t.column :data, :text
      t.column :updated_at, :datetime
    end

    add_index :sessions, :session_id
    add_index :sessions, :updated_at
  end

  def self.down
    drop_table :sessions
  end
end

Maurice

P.S. In the meantime and because I wanted to avoid similar
issues in
the future, I have moved very close to using rails standard
conventions by:
a) setting up a new seperate oracle user, which allows me to
use
standard table names, and avoid name clashes when separate
projects
each have their own f.ex. schema_info table etc.
b) turned off table_name_prefixing
c) turned off pluralizing_table_names


On 30 Sep., 20:08, "eu.gesse...googlemail.com"
<eu.gesse...googlemail.com> wrote:
> Just out of curiosity, can you post up your migration
file?
>
> /Jason


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )