similar to: Write a Primary Key in Create

Displaying 20 results from an estimated 50000 matches similar to: "Write a Primary Key in Create"

2007 Sep 04
2
Use of uniqueidentifer type for primary key?
I''m working on a legacy SQL db. It is distributed, to they are using the uniqueidentifier type for the primary key. At first, at least, I won''t be updating records, but I''m seeing a lot of negativity about using anything other than incrementing integers for the pk--which are obviously inadequate for this environment. It is enough to use set_primary_key? Do I need
2009 Mar 09
3
multiple columns primary key
Hi all, I have two tables: TABLE 1 A pk - fk (referencesc TABLE 2) B pk C pk D pk E F TABLE 2 A pk G H I L I don''t use incremental field (id). I''d like don''t use find_by_sql. How can I define both models to use correctly find method (with include)? With only one column primary key I haven''t problems. I thought two solutions, but I don''t like these
2007 Aug 30
1
belongs_to with foreign keys that reference non primary key columns
Hello, I have a situation where the foreign key into a table doesn''t correspond to that table''s primary key: my_table ------------- id (pk) name ... other_table -------------- id (pk) my_table_name (fk references my_table(name)) ... I want to be able to say something like: class OtherTable < ActiveRecord::Base belongs_to :my_table, :foreign_key => { :my_table_name
2006 Feb 28
0
ActiveRecord: Legacy primary keys
Hi, I''m building a frontend for a legacy schema, with tables like this: CREATE TABLE `types` ( `a_type_cd` varchar(6) NOT NULL default '''', `a_type` varchar(30) NOT NULL default '''', PRIMARY KEY (`a_type_cd`) ); The primary key is specified by the user (not auto-generated), and needs to be updateable. I create the following a base class to
2010 Aug 19
1
Composite primary keys and :joins=>
I have a legacy db with the following simplified structure: Table-A: type_key, code_key, name, ... # PKs are type_key and code_key, there is no id col and I cannot alter this db Table-B: # each row has only the code as a foreign_key, the type_key is hard-coded to "FOOKEY" an_id, code, ... Models: class TableB < AR::Base set_table_name ''table_b''
2012 Sep 09
2
Patch for ssh-keygen to allow conversion of public key to openssh format
Hi, I needed to convert a public RSA key to autorized_keys format and found ssh-keygen lacking this feature. I made the option -Q publicfile to allow an conversion like ssh-keygen -Q pubrsa.pem -y The patch is produced using unified diff and made on latest release. If you like it and can make a patch for the man-page also! Regards, /Lars -------------- next part -------------- diff -u
2013 Jun 03
1
Is uniqueid/sequence a safe CDR table primary key ?
Hi, When dealing with CDR SQL tables, I always added an auto-incremented cdr_id key as a primary key, just in case provided uniqueid key went wrong. Now I'm facing a situation where I need to insert into a database's table and from the dialplan, a reference to the CDR record which is currently processed. So my questions are: 1. Can uniqueid/sequence (or uniqueid/sequence/calldate)
2006 Oct 09
2
Multi-column primary key in joining tables
Folks, What is the convention for primary key fields in joining tables in RoR? I have a model representing a joining table, and I can''t seem to prevent ActiveRecord''s find method from looking for an id column. I don''t have an auto-incremented field in my table (happy to add one if that is the convention), and therefore my primary key is the combination of the 2 foreign
2006 Mar 12
5
AR - Migrations - how to use a varchar as primary key instead of int ?
Hi I''d like to have a varchar primary key named id instead of the default int id. Does anyone knows how to specify this from migrations ? Should I also specify something in the model class ? thanks! Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060312/797bca4b/attachment.html
2001 Dec 04
0
PATCH: log key fingerprint upon successful login
This patch is against 3.0.2p1. It produces output like the first line in the example below for both v1 and v2 logins. Logging is turned on by sticking ``LogFingerprint yes'' in sshd_conf. It would be nice if something like this would make it into OpenSSH. Dec 4 14:21:09 lizzy.bugworks.com sshd[7774]: [ID 800047 auth.info] Found matching RSA1 key:
2011 Jun 27
2
insert value of primary key into another field before record is saved
Hey all, I created a seed task: def books! books = Book.where(:type_id => Type.find_by_name(''Fiction'')).order(''id'') books.each do |book| @books = 4.times.map do |i| subbook! "#{book.book_num}-#{i}".to_s, :book_state => BookState[:available].id, :book => book end end puts "log it:
2002 Jan 29
2
Key fingerprint logging
Hello there! I have made a patch against OpenSSH 3.0.2p1 which allows the fingerprint of the accepted key to be printed in the log message. It works with SSH1-RSA and SSH2 pubkey (DSA+RSA) authentication. This feature is controllable by the LogKeyFingerprint config option (turned off by default). Michal Kara -------------- next part -------------- diff -u5
2009 Mar 07
0
Be careful of BIGINT primary key fields in MySQL. Will cause problems with ActiveRecord create (but not find)
The MySQL/Ruby library doesn''t properly handle inserts into tables with the primary key being a BIGINT If the ID returned to the MySQL/Ruby library is LARGER than the INT range, the value is returned to Ruby truncated and incorrect. This is then passed up to ActiveRecord and into the id field of your model. The actual INSERT worked properly and when do you an ActiveRecord find for the
2005 Jun 29
3
Setting the value of a primary key field
I have a table that is to hold all ISO 639 language codes: alpha3t, alpha3b, alpha2, that bunch. It also (indirectly) holds language names, but that''s off-topic. alpha3t is the primary key, so I''ve told Active Record about this by saying set_primary_key "alpha3t" within the Language model. (Don''t try to call your models things like ISO639 (won''t work
2006 Jun 09
2
Support for clustered primary key in rails?
Hi, I need to support a legacy database that mostly uses clustered primary keys (i.e. every primary key consiststs of multiple fields not just a single one. E.g. if I have tables A,B and C and C depends on tables A and B, then C''s primary key will consist of 3 or more fields- the foreign key fields pointing to A and B and a field or fields from C that will make C unique- in
2010 Jan 18
0
Will SIP connection stop automaticlly when detect no voice between the channel after a period of time?
hi, in my test, i noticed that sip connection will hangup automaticlly when no speaks between the channel. about half a minute. is this the asterisk inner mechanism or is my configuration error? Thanks! messages on the cli as follow: -- SIP/1003-0000001d is ringing -- SIP/1003-0000001d answered SIP/1004-0000001c -- Stopped music on hold on SIP/1004-0000001c [Jan 18 10:08:42]
2006 Nov 04
0
ActiveRecord, insert and not auto-incremented primary keys...
Hi, After playing while with ActiveRecord, I''m surprised it isn''t easier to insert data into a table whose primary key is not auto-incremented by the database server. The following code... --------------------------------------- -- MySQL database "test" --------------------------------------- CREATE TABLE gardens ( code integer NOT NULL, name
2005 Mar 16
0
Sun One Directory Server 5.2 ldapclient init -v -a Problem
Hi All, I Have installed the Sun Directory Server 5.2 from JES 2004Q2 CD's with following options /etc/hosts 192.168.1.23 train01.tipu.com.pk train01 loghost DNS is running for tipu.com.pk on the same machine and here is /etc/resolv.conf domain tipu.com.pk nameserver 192.168.1.23 Directory Server installed using the following Suffix dc=tipu,dc=com,dc=pk when i run
2012 Jun 13
0
[LLVMdev] llvm-mc problem after a pass
Something is adding a bogus comment string. Specifically " # %case^M18 ", where "^M" is a single ctrl-M character. The ^M is seen by the asm parser as an end-of-line, so the '18' is a new token at the start of a line, not part of the comment. Is your pass perhaps using label names which might include literal "^M" characters? -Jim On Jun 13, 2012, at
2007 Jun 21
11
one-to-one, compound primary key, naming conventions
My understanding is that, given tables Alpha and Beta that the table which holds the 1-to-1 relation will be called Alpha_Beta (or is it alpha_beta?). So far so good. alpha_beta will have, lets say, two fields: alpha_id and beta_id. Seems that it''d be a good idea for those two fields to form a compound primary key, ensuring there are no duplicates. However, RoR doesn''t