similar to: Primary keys and migrations

Displaying 20 results from an estimated 5000 matches similar to: "Primary keys and migrations"

2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone, For one of our projects we have a need to deploy and maintain a demo. As a result I''ve attempted to setup a set of rake tasks for the job. My goal is have one rake task called "deploy_demo" which purges the database, migrates to the current schema, and loads the db from a set of fixture files in a specified location. I''ve written two new tasks the perform
2006 Apr 22
7
Proper Database Design For A Newbie
Hi all, I am starting out learning Ruby on Rails (coming from a PHP background) and I have a question about proper database design. Let me give you a quick example of what I want to do: Database: CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `login` varchar(40) default NULL, `email` varchar(100) default NULL, `crypted_password` varchar(40) default NULL, `salt`
2006 Apr 05
4
How to do IN(?) query?
I''m trying to do an IN query, where I have an array of user objects imaginatively named ''users'': :conditions=>["user_id IN (?)", users.collect{|u| u.id }.join('','')] this ends up with: ... IN(''1,2,3'') ... Obviously I want this to be: ... IN(1,2,3) ... or even ... IN(''1'', ''2'',
2006 Mar 19
3
Can''t add data during migration if column is called "type"
Hi I''m new to Rails. This is my first application and I''m trying to set up a schema I''ve hand-crafted as a migration. Does anybody know why this... # deposit_types create_table :deposit_types do |table| table.column :type_code, :string, :limit => 20, :null => false table.column :description, :string, :limit => 50, :null => false
2011 Jun 11
1
Having a problem adding a foreign key
I keep getting this exception "SQLite3::SQLException: no such column: books.user_id: SELECT "books".* FROM "books" WHERE ("books".user_id = 4)" ,which sounds like there is no user_id in books table.So i just installed foreigner plugin and added " t.integer :user_id, :null => false" and "add_foreign_key(:books, :users)" in book
2018 Jun 20
2
Bad message_id occasionally when connecting a MacOS to a freebsd running 4.8.2
Hi, I am running Samba 4.8.2 with fruit and use it to connect a MacOS to the server. Mostly it works very good, but occasionally the connection halts or the Mac disconnects, and in the log I find these messages: Jun 20 13:00:00 orca smbd[6033]: [2018/06/20 13:00:00.856101, 0] ../source3/smbd/smb2_server.c:641(smb2_validate_sequence_number) Jun 20 13:00:00 orca smbd[6033]:
2006 Jul 22
1
browser_detect plugin
I just knocked up a quick plugin based on Rafael Lima?s Javascript which was inspired by the Browser selectors in CSS post by 37signals. It?s pretty naive at the moment, but could be nice to build on in the future. It adds two helper methods available in your views - browser_is? and browser_name <%= browser_name %> => mozilla (or whatever) <% if browser_is? :mozilla %> do
2023 Jul 21
2
Bug 15346 - 2-3min delays at reconnect with smb2_validate_sequence_number: bad message_id 2 still on new 4.17.10
Hello to all, I can confirm, that the bug, smb2_validate_sequence_number: Jul 21 08:22:44 dom2 smbd[1908004]: smb2_validate_sequence_number: smb2_validate_sequence_number: bad message_id 2 (sequence id 2) (granted = 1, low = 1, range = 1) Jul 21 09:24:39 dom2 smbd[1908332]: [2023/07/21 09:24:39.140658, 0] ../../source3/smbd/smb2_server.c:677(smb2_validate_sequence_number) Jul 21 09:24:39 dom2
2010 Dec 30
3
rake db:seed with has_many through (m:n with seperate table)
My model consists of users and tasks (m:n), the relation is stored in a seperate table sharedtabs (that contains some extra fields). Between tabs and tasks there is a 1:n relation. I have trouble writing my seed.rb: works: (1) tab = Tab.create(:name => ''Admin'', :category => 0) tab.tasks.create(:name => ''Admin_Tab1_Private Task 1'') works: (2)
2006 Feb 20
3
file_column and login_engine incompatibilities
Hi, has anyone come across any incompatibilities between file_column and login_engine? I''ve been having strange issues where a User model with file_column in it is failing to save the images properly. Everything uploads to the tmp dir fine, but then it never gets copied to the proper permanent location. No errors - everything happens fine except for that final part. I have
2005 Aug 15
5
Customized Autocompletion
In the customized autocomplete demo, how does it know what content to use as the value of the autocomplete? The returned UL has the name, email address and an image. Yet only the name is used. How does it do this? I''ve been trying to get something similar going all morning with little success. Also, what does :skip_style=>true do? I couldn''t seem to find a mention of it
2006 May 19
1
LoadError - no such file to load -- pathname (Dreamhost)
I''ve started getting the following error on Dreamhost when trying to run any scripts or dispatch.* [barry]$ ruby -d script/server Exception `LoadError'' at ./script/../config/boot.rb:6 - no such file to load -- pathname ./script/../config/boot.rb:6:in `require'': no such file to load -- pathname (LoadError) from ./script/../config/boot.rb:6 from
2005 Aug 19
1
In place editor, load in text
I''ve been testing the in-place-editor on a few things and it works well. One use-case I''ve just come across though is the need to load in the text from somewhere other than the source of the page. For example, I have a block of text which is marked up in texttile/markdown/whatever. Editing that block should bring up the unformatted markup, not the HTML it''s turned
2006 Jun 05
0
Failed to install Globalize plugin
My envrionment is Rails 1.1.2, Ruby 1.8.4, MySQL 5.0.21 on WinXP. When I run ''rake migrate'' after pulling the lastest 1.1 branch of Globalize plugin, I get the following error message: (in C:/Rails/Application/medicalmind) == GlobalizeMigration: migrating ============================================== -- create_table(:globalize_countries, {:force=>true}) -> 0.2110s
2006 Jan 05
5
File_column crashing WEBrick when using :magick options
I''m trying to use file_column in an app I''m writing. Simple file uploads are working fine. However, when I try and use the :magick options to make resized versions, WEBrick dies. This is the Media model: class Media < ActiveRecord::Base file_column :media_item, :magick => { :versions => { :thumb => {:size =>
2006 Feb 17
2
Accessing just the body of email in text format?
I am interested in accessing the body of the email in text format using IMAP to receive emails. So far I have tried the following #body = imap.fetch(message_id, "BODY[TEXT]") #body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] But both of the above give me body text + the headers including Content-Type etc. How can I access
2006 Apr 12
8
500 Server Error - stumping me at the moment
I''m trying to deploy an app on Dreamhost and I''m getting the infamous 500 Server Error. Nothing in the rails logs because it looks to be happening before it gets there. In the apache error logs we have: [Wed Apr 12 12:51:51 2006] [error] [client 194.80.32.9] FastCGI: comm with (dynamic) server "/home/rlivsey/thatsprogress.com/current/public/dispatch.fcgi"
2009 Feb 22
2
Mysql error unknown column 'columns.user_id'
Had this error when trying to add comments to another user''s photo. ActiveRecord::StatementInvalid in User photosController#show Mysql::Error: Unknown column ''comments.user_id'' in ''on clause'': SELECT photos.`id` AS t0_r0, photos.`user_id` AS t0_r1, photos.`title` AS t0_r2, photos.`body` AS t0_r3, photos.`created_at` AS t0.... I did create a user_id
2006 Jan 20
1
stack level too deep from has_many / belongs_to relationship
I have the following 3 models (2 models joined by an intermediate): 1. class Exercise < ActiveRecord::Base 2. has_many :routines, :class_name=>''RoutineExercise'' 3. end 1. class Routine < ActiveRecord::Base 2. has_many :exercises, 3. :class_name=>''RoutineExercise'', 4. :order=>''position'' 5. end 1. class
2006 Sep 27
5
Question about has_one
I have a question about regarding the use of ''has_one'' in this scenario: Schema: User ---- id first_name last_name UserMessage ---- user_id message_id Message ---- id Assuming business rules dictate that a Message can have at most ONE User (let''s assume a message can be created without a user associated to it), these are my questions: 1) How would I use has_one