Feature #536
closedSupport Oracle SGDB -- db:migrate worked with errors if i use oracle db
Description
Hello,
I try to use Oracle 10.2.0.5 for Foreman 0.1-6 backend. In process create schema I see next issue:
1. In file db/migrate/20090730152224_create_ptables.rb
t.string :layout, :limit => 4096, :null => false
and Oracle generates error:
CreatePtables: migrating ================================================
-- create_table(:ptables)
rake aborted!
An error has occurred, all later migrations canceled:
OCIError: ORA-00910: specified length too long for its datatype: CREATE TABLE "PTABLES" ("ID" NUMBER NOT NULL PRIMARY KEY, "NAME" VARCHAR2 NOT NULL, "LAYOUT" VARCHAR2 NOT NULL, "OPERATINGSYSTEM_ID" NUMBER, "CREATED_AT" DATE, "UPDATED_AT" DATE)
2. At execution scropts:
- 20090915030726_change_report_field_type_to_text.rb
- 20100115021803_change_mysql_reports_column.rb
- 20100325142616_update_fact_names_and_values_to_bin.rb
- 20101018120548_create_messages.rb
- 20101018120603_create_sources.rb
I see error:
ChangeReportFieldTypeToText: migrating ==================================
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `[]' for nil:NilClass
Updated by Ohad Levy about 14 years ago
I have no oracle db to test, but can you try changing the following line in db/migrate/20090730152224_create_ptables.rb
t.string :layout, :limit => 4096, :null => false
to
t.text :layout, :null => false
Updated by Nikolay Aralovets about 14 years ago
It's not worked, because Oracle needs to set size for datatype. I change this as follows:
t.string :layout, :limit => 4000, :null => false
4000 is max size for datatype varchar2
Updated by Nikolay Aralovets about 14 years ago
Variant of a solution of a problem 2:
Add in if .. end condition else "do nothing" :)
For example in 20090915030726_change_report_field_type_to_text.rb add:
if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql"
execute "ALTER TABLE reports MODIFY log text;"
else
'do nothing'
end
Updated by Ohad Levy almost 14 years ago
Nikolay Aralovets wrote:
Variant of a solution of a problem 2:
Add in if .. end condition else "do nothing" :)
For example in 20090915030726_change_report_field_type_to_text.rb add:
if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql"
execute "ALTER TABLE reports MODIFY log text;"
else
'do nothing'
end
would you like to submit it as a patch for this ticket? (best if you want to use git so we can keep your details within the official foreman repo).
Updated by Ohad Levy over 13 years ago
- Status changed from New to Need more information
Hi,
Does this ticket still relevant?
Updated by Benjamin Papillon over 12 years ago
- Tracker changed from Bug to Feature
- Subject changed from db:migrate worked with errors if i use oracle db to Support Oracle SGDB -- db:migrate worked with errors if i use oracle db
- Status changed from Need more information to New
I update this ticket as Feature request. Devs are lacking a test environment to validate oracle right now.
Updated by Tomer Brisker almost 9 years ago
- Description updated (diff)
- Status changed from New to Rejected
Oracle DB is not supported by Foreman as a backend. Please use a supported database such as PostgreSQL or MySQL.