Displaying 20 results from an estimated 1000 matches similar to: "Migrations: column option "offset"?"
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails!
How do I change the behaviour of one method in
ActiveRecord::ConnectionAdapters::SchemaStatements ?
Full story:
I''d like to mangle
ActiveRecord::ConnectionAdapters::SchemaStatements
so when it creates a new sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat
2008 Feb 26
5
Rails 2.0.2 MySQL 'year' datatype missing from ActiveRecord?
Hi all,
This is my first post to the forum, and I''ll point out right away that
I''m a noob to everything, Ruby, Rails, MySQL, etc., so I expect that I''m
wrong here, but is the ''year'' datatype missing from ActiveRecord in
2.0.2? According to my MySQL 5.0 reference manual, ''year'' is a datatype,
but when I try to run a migration that has
2010 Aug 22
1
rails3: t.index in migrations not working anymore
Hello,
I''m playing around with Rails3 and trying to upgrade one of my
applications to Rails 3.0.0.rc and I get an error which should be still
working.
Migration:
t.index :name
When I execute rake:
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `index'' for
#<ActiveRecord::ConnectionAdapters::TableDefinition:0x4b2b6b0>
Does some one
2009 Sep 28
5
Multi-databases support
Hi,
While I was hacking ovirt-server, I have found that it's currently
restricted to Postgres DB. Even if I like postgres for serious work on a
server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
I have googled on rails in order to find a good answer for the "foreign
key problem" which forces OVirt to stay on pg. I have found a plugin on
this particular
2006 Jan 01
11
Migration db_schema_import always fails.
I have not been able to get DB migrations to work at all in Rails 1.0
for me. On multiple platforms I continually get the same errors. It
took me awhile to figure out some initial things, such as Migrations
don''t seem to support Enum column types, and doesn''t really support
Foreign key relationships (the constraints at least). After changing
my DB schema to jive more with the
2006 Mar 04
1
active migration gives undefined_method ''string_to_binary''
has anyone ever seen that:
c:\rails\test>rake migrate --trace
(in c:/rails/test)
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
rake aborted!
undefined method `string_to_binary'' for
ActiveRecord::ConnectionAdapters::ColumnDefinition:Class
2010 Aug 08
0
registerable method undefined in Devise migration (was Re: Re: No route matches)
On 8 August 2010 23:39, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> I tried to make the application from scratch again, and
> notices that I get the following when I run: $ rake db:migrate
>
> (in /Users/abder/Desktop/Rails/auth)
> == DeviseCreateUsers: migrating
> ==============================================
> -- create_table(:users)
2007 Sep 27
2
How specify size of string column in a migration
I am new to RoR. How do you specify the size of a string column in a
migration? The examples I''ve see are all of the form:
t.column :name, string
which produces a VARCHAR(255). I want a VARCHAR(40).
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to
2006 Apr 19
6
undefined method `create_table'' for #<LoginController:0x5e60
I am geeting the foolowing error.
undefined method `create_table'' for #<LoginController:0x5e60110>
I wrote the crete action in application controller.
I am coping ther total worng please help me!
class ApplicationController < ActionController::Base
model :cart
model :line_item
before_filter :authorize
def create
# create_table() yields a TableDefinition instance
2012 Mar 02
2
Change DB data type and limited decimals
Rails3.1.3
I have db type,
startp:integer
I need to change it to float. More specifically,
1.2, 45.1, 143.8 ...
I have two questions:
1. Is removing and adding the field through migration the only way?
in other words, is there a single command to change the type?
2. Is there anyway to limit the decimal place to only one?
56.3, 34.2... are acceptable, but 23.112, 77.34, ... are
2006 Aug 08
2
Problem with plurals, migrations?
Hi,
Ruby 1.8.4
Rails 1.1.4
Windows XP Pro
I''m hitting an issue with migrations that I suspect relates to
pluralization. Here''s the migration:
class Hardware < ActiveRecord::Migration
def self.up
create_table :hardware do |h|
h.column :vendor, :string, :limit => 32
h.column :model, :string, :limit => 32
end
2010 May 28
2
Suggestion for improving value_to_boolean column conversion
Hi fantastic rails core developers.
Speaking of version 2.3.5:
I find it rather error_prone that values such that "some text" is
silently converted to false when stored in a boolean DB field.
Among other things it means that assign "some text" to boolean fields
on a model will not generate any validation messages (it will silently
be converted to false).
I think it is like
2006 Apr 30
4
Migration, BigInts, and string lengths
Howdy Y''all,
I was thrilled to recently discover migrations, as that framework
addresses a common problem in an elegant way. I have, however, gotten
tripped up a bit as I''ve worked with them.
The first problem I encountered was that, though I was using a BigInt
data type in a field in my dev database, my unit tests were failing
because when I copied the schema from the dev
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but
for now I''ve hacked my own addition on for just PostgreSQL.
The following code extends every Column object returned by
MyModel.columns to support a new #required? method, which indicates if
the column may or may not be null.
The following is a huge hack - suggestions on a cleaner way to add this
functionality
2007 Oct 08
1
How to get database adapter type programmatically in rails?
Hi,all
I am developing a Rails application supporting both Mysql and Oracle.
I have to use Native SQL statements some place. While we know the SQL
grammar is quite different for Mysql and Oracle, so I have to get
database adapter type programmatically in my codes to process
different native SQL statements. I haven''t found any document for this
situation. After some research, I have found
2007 Mar 25
1
Can't use models in migrations
Hi there,
This always used to work for me... but not now. I want to blame Rails
1.2 but I''m sure its not.
I can''t use AR models in my migrations. To make sure its not just my
dodgy code I tried to do the same with a well known plugin..
acts_as_versioned.
A migration such as the one below (taken from acts_as_versioned) is
giving the error
undefined method
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".
2006 Jan 13
1
How to disconnect to a database????
Hi,
We have experienced some problems with
ActiveRecord::Base class of Ruby-Rails. We are
building a web-application based on the Ruby-rails
framework and the web-application needs to access to
difference databases, so we do not pre-define our
database accesses in the database.yml file. In fact,
we are using the
ActiveRecord::Base.establish_connection() to connect
to our database, the function
2006 Mar 21
2
Migration ~ Create
In one of my migration files I have the following:
===========
def self.up
User.create :name => ''John Kopanas'', :email =>
''john@kopanas.com'', :password => ''test''
end
===========
When I run it I get the following error:
===========
undefined method `create'' for