Displaying 20 results from an estimated 146 matches for "drop_tables".
Did you mean:
drop_table
2006 Jun 13
11
Question: Migration - multiple creates
I want to create a migration file that creates multiple tables, so i''m
guessing the correct format would be:
Can anyone confirm ? I''m guessing that each new create script requires a
seperate class so formatted this way. Perhaps I''m wrong.
TIA
Stuart
class CreateTable1 < ActiveRecord::Migration
def self.up
create_table :table1s do |t|
t.column :length,
2006 Mar 31
2
A.R. Associations problem
Hello,
I''m learning A.R Associations by creating a simple forum that consists
of 3 tables: ahuthors, topics and posts. This is the schema:
class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration
def self.up
create_table :authors do |t|
t.column :username, :string
t.column :email, :string
t.column :created_on, :datetime
end
create_table
2006 May 25
5
rake migrate VERSION=0 doesn''t appear to execute
All,
I''ve decided to jump into Migrations before I get too far along on the
DB side of things.
I already have some tables built, and I went ahead and built the
migration that would have created them from scratch, and I made sure
that there was a self.down section to drop them. I wanted to verify
that I could roll back so I figured I would use rake to drop these
pre-existing tables
2006 Feb 19
3
multi-sql problem?
hi all,
how to excute multi sql statement in rails
#-------------------------------------------------------
sql_1 = ''drop table if exists test''
sql_2 = ''create temporary table test select * from test_1''
sql_3=''select * from test''
#-------------------------------------------------------
any ideas
all regards
--
Posted via
2008 Feb 19
1
[CruiseControl] RubyOnRails build 8896 failed
...ql_adapter.rb:407:in `execute_without_counting''
./test/cases/helper.rb:46:in `execute''
./test/cases/../../lib/active_record/connection_adapters/abstract/schema_statements.rb:116:in `drop_table''
./test/cases/associations/eager_load_nested_include_test.rb:45:in `drop_tables''
./test/cases/associations/eager_load_nested_include_test.rb:43:in `each''
./test/cases/associations/eager_load_nested_include_test.rb:43:in `drop_tables''
./test/cases/../../lib/../../activesupport/lib/active_support/core_ext/kernel/reporting.rb:40:in `silence_...
2006 Feb 15
2
migrations still
I think I am pissing into the wind to make migrations work at this
point.
Looking at
http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations
it appears that the problem that I am having is that postgresql can''t do
the drop_table part because of the foreign_key keys (constraints) which
requires ''cascade'' as an option to drop some of the tables that have
other
2008 Oct 26
3
Undefined method f_title
Hi,
This is my migration:
class CreateSampleForms < ActiveRecord::Migration
def self.add_data
SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default
(Empty)'', :description => ''Use this template to create a blank form.'')
end
def self.up
create_table :sample_forms do |t|
t.string :name, :null =>
2006 Mar 29
2
Rake Migrations for Rails 1.1
Hi all. I keep having the following error when I invoke the rake
db:migrate command for Rails 1.1 (Ruby 1.8.2 -- Windows 2000)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== Realtorex: migrating
=======================================================
-- create()
rake aborted!
undefined method `create'' for
2006 Apr 07
4
How to generate mapping with migration
Hi there, I''ve tried to add a m:n mapping table using the migration
mechanism.
ruby script\generate migration add_categories_notes_mapping
and filled the migration file with:
class AddNotesCategoriesMapping < ActiveRecord::Migration
def self.up
create_table :categories_notes do |t|
t.column :category_id, :integer, :null=>false
t.column :note_id, :integer,
2006 Mar 15
3
Self-referential join model does not work
I have been trying to model a labeled graph using ActiveRecord (trunk
version). Basically, I have a ''Node'' model which represents a node linking
to other nodes. Links (aka edges) are labeled (i.e., have a ''label''
attribute and other behavior). Thus I decided to model edges as an ''Edge''
model and use a ''has_many :trough''
2006 Jun 21
1
Migration with foreign key won''t work
Hi all
I use the plugin which supports foreign keys with migrations:
http://wiki.rubyonrails.org/rails/pages/Foreign+Key+Schema+Dumper+Plugin/versions/12
I have created the following migration file:
class AddArtistsTable < ActiveRecord::Migration
def self.up
create_table :artists, :force => true do |t|
t.column :name, :string, :limit => 100
t.column :artist_type_id,
2009 Nov 04
0
The error occurred while evaluating nil.prefetch_primary_key
The error occurred while evaluating nil.prefetch_primary_key?
Hi,
I have a problem with a model when I have 3 belongs_to relations in one
the middle.
This example is a subset of a grid-routing project:
n 1
1 n +------------ Project
Connection ------- ConnectionCost
+------------ WaySearchRun
2006 Apr 23
2
Rails Recipes
Rails Recipes ... has got some very appetizing recipes. However, I have
a hard time starting. For example, the very first recipe,
InPlaceEditing, how and where do I run this code to create the table?
Thanks!
class AddContactsTable < ActiveRecord::Migration
def self.up
create_table :contacts do |t|
t.column :name, :string
t.column :email, :string
t.column :phone,
2010 Jun 29
3
belongs_to. Association methods don't pass data to DB
Hi.
I have a problem with the association methods which passed to a model
through a belongs_to declaration. Here''s an illustration of the issue:
GIVEN:
# migration
class CreateArticlesAndAuthorsTables < ActiveRecord::Migration
def self.up
create_table :articles do |t|
t.text :title
t.integer :author_id
end
create_table :authors do |t|
t.text
2006 Apr 18
6
Postgresql and ActiveRecords problems
Hi all. I have a problem with postgresql PK columns and ActiveRecord.
The error is: PGError: ERROR: null value in column "item_id" violates
not-null.
Ok, it''s wrong to insert NULL into PK columns, but rails doing it. How
to fix? So sad..
2006 Jan 21
5
Help...why ''rake migrate'' can''t be executed on RadRails
''rake migrate'' command can''t be executed on RadRails?
I found Terminal Window at RadRails and executed ''rake migrate'' on that
terminal
many times.but nothing happend,even error messages.
I made InitialSchema file like these and configured database.yml.
of course I made database before executing ''rake migrate''
anyone,get me
2006 Jul 10
3
Problem with migrations
I am trying to start my first project after going though the Depot
application in prog prog''s book. For some reason one of my migrations keeps
bombing. I just try to setup a couple tables with some default information
and even with changing the name of the second table and other minor tweaks
it just does not work. I am connected to the db, the first table does get
filled out.
Any help
2011 Mar 22
2
Problems with SQLite3
Hi!
I''ve got a very strange problem. Suddenly the SQLite3 Backend stopped
working.
Example 1:
> rake db:rollback
== CreateProducts: reverting
=================================================
-- drop_table(:products)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE
2006 Aug 17
0
super-newb needs help with has_many and other things...
I am brand new to oop and am having a difficult time getting my head
around some ruby stuff. In specific, I am trying to create a library
style app that lists topics, articles and comments. I have a table
called topics, a table called articles and a table called comments. My
models, controller and view are all listed below. What I want to happen
is to have the list view list each topic along
2008 Apr 30
4
Beginner mysql problem
I am new to rails and have come across a problem with a sample
application I was working on.
When trying to use rake migrate I got the error listed below.
my db file contains the following
class ContactDb < ActiveRecord::Migration
def self.up
create_table "people" do |t|
t.column "id", :integer
t.column "name",