search for: native_database_typ

Displaying 9 results from an estimated 9 matches for "native_database_typ".

Did you mean: native_database_types
2008 Feb 26
5
Rails 2.0.2 MySQL 'year' datatype missing from ActiveRecord?
...ation that has a t.year column, I get this: rake aborted! undefined method `year'' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x274a070> I opened up the mysql_adapter.rb file in my frozen 2.0.2 ActiveRecord, and sure enough, ''year'' was missing from the native_database_types hash, so I added it. rake db:migrate still doesn''t work (continues to give the same error, and I can''t find the TableDefinition), however. Any suggestions? I can of course use a ''date'' as a workaround, but I''m building a discography, and ''year...
2008 Nov 03
17
SQL queries in Rails
Hi... I want to know the equivalent instructions to insert, update, search and delete a registry. I know Rails can do it easily Thanks to ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using SQL to do the migration (Including the foreign keys), I need to know if I can use SQL queries to do those actions. Is there an example out there? I uncommented
2007 Nov 28
0
Where to override ActiveRecord::ConnectionAdapters::SQLServerAdapter?
I''m working on an existing global database running on MS SQL Server. The appropriate primary key is uniqueidentifier, so I want to set ActiveRecord::ConnectionAdapters::SQLServerAdapter#native_database_types[:primary_key] = "uniqueidentifier NOT NULL newid() PRIMARY KEY". Obviously, I need to override the native_database_types definition, but I really don''t know where I should put the code so rails picks it up. I want to do this in migrations. --~--~---------~--~----~----------...
2006 Jan 07
1
Migrations and doubles?
I''m trying to start using migrations (I <3 migrations!) on a project that stores geocode data in the database. This is a pretty major problem because float is not precise enough to store this information. Are there plans to support double? What are my options here? Cheers, Jim -- Posted via http://www.ruby-forum.com/.
2006 Mar 26
1
add_primary_key Re: #3735
Hey guys, With the addition of has_many :through, a number of people will probably want to add primary keys to their current ''rich association'' tables. Currently we don''t have an add_primary_key. We have a ticket for it[1], and I''ve attached a simple patch[2]. It works fine for mysql and postgres (8) and Rick is looking at sqlite. Could those of you who use
2006 Feb 05
0
Enum patch for Rails
...=== --- activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb (revision 3486) +++ activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb (working copy) @@ -235,7 +235,15 @@ def type_to_sql(type, limit = nil) #:nodoc: native = native_database_types[type] - limit ||= native[:limit] + # this is a special case, because data type differs + case type + when :enum + fail ":enum column limit must be specified" if limit.nil? + fail ":enum column limit must be an array" unless...
2006 Jan 13
19
Problems with scaffold''s parameter on Oracle
Hi I run Ruby on Rails on Oracle XE. I have a simple table: create table customer(id number primary key, name varchar2(100)); And ruby script\generate model Customer ruby script\generate controller Customer http://localhost:3000/customer/ - show a fine list, but when I click show/edit/destroy, I get an ORA-01722: OCIError: ORA-01722: invalid number: select * from (select raw_sql_.*,
2006 Jul 16
4
migrations questions: MySQL -> postgreSQL
I started my app before migrations were a best practice and have been using SQL scripts. Now I''m looking at potentially having to move from using MySQL to postgreSQL to use a particular hosting provider. I understand migrations are the way to go to make this ''easy'' but it also looks like the use of migrations introduces extra work in other areas. I''d really
2006 May 09
9
Working around the year 2038 bug in Ruby''s Time class?
I would have never imagined that I''d be bitten by the Y2038 bug someday... but it just happened and, trust me, it hurts! I have to deal with a database containing datetime fields with dates up to 2050 and more. ActiveRecord raises an exception because Ruby''s Time class implementation. Besides running Ruby on a 64-bit platform, what can be done to avoid that? Does a