Message from discussion
Some kind of automatic adding index on forgotten migrations
Received: by 10.224.105.205 with SMTP id u13mr11529625qao.6.1351694037561;
Wed, 31 Oct 2012 07:33:57 -0700 (PDT)
X-BeenThere: rubyonrails-core@googlegroups.com
Received: by 10.229.78.102 with SMTP id j38ls2210018qck.7.gmail; Wed, 31 Oct
2012 07:33:50 -0700 (PDT)
Received: by 10.224.219.144 with SMTP id hu16mr8834585qab.1.1351694030124;
Wed, 31 Oct 2012 07:33:50 -0700 (PDT)
Received: by 10.224.2.134 with SMTP id 6msqaj;
Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
Received: by 10.58.239.41 with SMTP id vp9mr154333vec.38.1351681312342;
Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
Received: by 10.58.239.41 with SMTP id vp9mr154331vec.38.1351681312304;
Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
Return-Path: <ratnadeepdeshm...@gmail.com>
Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180])
by gmr-mx.google.com with ESMTPS id dj17si446193vdb.1.2012.10.31.04.01.52
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of ratnadeepdeshm...@gmail.com designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ratnadeepdeshm...@gmail.com designates 209.85.220.180 as permitted sender) smtp.mail=ratnadeepdeshm...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vc0-f180.google.com with SMTP id fl13so1282797vcb.11
for <rubyonrails-core@googlegroups.com>; Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
bh=hCVcnCdrd+jdNSbbXvySsGYCjAfswWimemGGBSIOGTc=;
b=ugEDf0Sd6ZhwA8mGXZFXZHR7/K4aZGaZIDASDCCcluTXcSnVmQw101NuS3jVSKtQK/
WL0G/96dQPSF5OKPSRIygA8582aqpWMPPARkHXk/3mLqYe6t/5yWJtFNZ+JHtjCVD4zi
yVIk/SAdTMN3zEdM2KzKFS/EeCWU3xZKuTaahaM9xNca30I004opWeJj1pkf3lSEPmEG
YRuvbztkeEpyOv323C8pcDcgxZ7AZFr4w0IFXda3t8gyh5j+blLToxe4zOhUfQssPq5+
/7aTHc8+SENNwWXkJrVEiKKinBetYmwbdj5PiVRG0u7+5gbvYcy3bOhvtd7mnQnIDhen
U46w==
Received: by 10.220.142.79 with SMTP id p15mr17284504vcu.71.1351681312103;
Wed, 31 Oct 2012 04:01:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.58.125.33 with HTTP; Wed, 31 Oct 2012 04:01:31 -0700 (PDT)
In-Reply-To: <0d480d84-4f69-49f5-93c4-b1a3d83fd05e@googlegroups.com>
References: <0d480d84-4f69-49f5-93c4-b1a3d83fd05e@googlegroups.com>
From: Ratnadeep Deshmane <ratnadeepdeshm...@gmail.com>
Date: Wed, 31 Oct 2012 16:31:31 +0530
Message-ID: <CABLT_LwF5+Q9tJeRsJ4VbkHjfkuvB6=oDQ+LYpt6cj-8poK...@mail.gmail.com>
Subject: Re: [Rails-core] Some kind of automatic adding index on forgotten migrations
To: rubyonrails-core@googlegroups.com
Content-Type: multipart/alternative; boundary=f46d042fdb3e751c9604cd58d4ab
--f46d042fdb3e751c9604cd58d4ab
Content-Type: text/plain; charset=ISO-8859-1
I use rails 3.2 and by default it does add indexes if column type is
specified as references.
--
Ratnadeep Deshmane.
http://appsurfer.com
http://rainingclouds.com
http://twitter.com/rtdp
On Tue, Oct 30, 2012 at 10:59 PM, Tino <tino.zoroto...@gmail.com> wrote:
> Hello, just asking for first time here...
>
> if you do in console:
>
> rails g migration *AddReferenceidToModel *type:*references*
>
> would you expect that Rails add index for reference_id field, cause it
> make sense always add index on field like that.
>
> i did that on my fork and it makes me happy every time I scaffold and
> forgot some fields ...
> :)
>
> regards, Tino
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/zpRD_04wfZQJ.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
--f46d042fdb3e751c9604cd58d4ab
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I use rails 3.2 and by default it does add indexes if column type is specif=
ied as references.<div><br clear=3D"all"><div><div>--</div><font color=3D"#=
999999">Ratnadeep Deshmane.</font><div><a href=3D"http://appsurfer.com/" ta=
rget=3D"_blank"><font color=3D"#999999">http://appsurfer.com</font></a></di=
v>
<div><font color=3D"#999999"><a href=3D"http://rainingclouds.com/" target=
=3D"_blank"><font color=3D"#999999">http://rainingclouds.com</font></a><br>=
<a href=3D"http://twitter.com/rtdp" target=3D"_blank"><font color=3D"#99999=
9">http://twitter.com/rtdp</font></a></font></div>
</div><br>
<br><br><div class=3D"gmail_quote">On Tue, Oct 30, 2012 at 10:59 PM, Tino <=
span dir=3D"ltr"><<a href=3D"mailto:tino.zoroto...@gmail.com" target=3D"=
_blank">tino.zoroto...@gmail.com</a>></span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
<div>Hello, just asking for first time here...</div><div><br></div>if you d=
o in console:=A0<div><br></div><div>rails g migration <b>AddReferenceidToMo=
del </b>type:<b>references</b>=A0<div><div><br></div><div>would you expect =
that Rails add index for reference_id field, cause it make sense always add=
index on field like that.</div>
<div><br></div><div>i did that on my fork and it makes me happy every time =
I scaffold and forgot some fields ...</div><div>:)</div><div><br></div><div=
>regards,=A0Tino</div><span class=3D"HOEnZb"><font color=3D"#888888"><div><=
div>
<br></div><div><br></div></div></font></span></div></div><span class=3D"HOE=
nZb"><font color=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Ruby on Rails: Core" group.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msg/rubyonrails-core/-/zpRD_04wfZQJ" target=3D"_blank">https://groups.=
google.com/d/msg/rubyonrails-core/-/zpRD_04wfZQJ</a>.<br>=20
To post to this group, send email to <a href=3D"mailto:rubyonrails-core@goo=
glegroups.com" target=3D"_blank">rubyonrails-core@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:rubyonrails=
-core%2Bunsubscribe@googlegroups.com" target=3D"_blank">rubyonrails-core+un=
subscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/rubyonrails-core?hl=3Den" target=3D"_blank">http://groups.google.com/g=
roup/rubyonrails-core?hl=3Den</a>.<br>
</font></span></blockquote></div><br></div>
--f46d042fdb3e751c9604cd58d4ab--