migration problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

migration problems

Joe Guerra
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Mugurel Chirica
Can you share some code? There are more changes to receive help that way.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL37D8FYW58p%3DWLp7mFV5ho8AKSzR7eOrhdSaeA0kk9pPTWosw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Jim ruther Nill
In reply to this post by Joe Guerra


On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]> wrote:
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

If you've already fixed the table manually, then you don't need to run the migration at all.  You have 3 hackish options

1.  Just delete the migration and update the old migration so it uses the correct column name.
2.  Insert the timestamp of the migration that you want to skip to a table called schema_migrations (not sure if this is
the exact name).  Rails basically checks this table to see which migrations need to run.
3.  Edit the migration so that it doesn't do anything, commit, deploy, run db:migrate.  Edit the migration again, commit,
deploy, run db:migrate.  The second db:migrate should not run the edited migration file.

May I ask why you decided to fix the table manually?
 
What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ8y7VcnBcg5PWMxb0y2LtMVqQNuLAgfeOE3L8AKDdoJ4F7LHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Joe Guerra
ok, I'm having difficulty with heroku, they are having some build problems...

I'll try later.  I guess commenting out the # rename table in change def should work?  

I was puzzled because the column title started with a capital letter, it worked fine in sqlite, but generated errors in postgres.  (so the quickest fix for me was to edit the column in postgress directly).   I belive I skipped this migration before, but I forget how I did that. 

Thanks,
Joe 

On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:


On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HLgRB17OAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

If you've already fixed the table manually, then you don't need to run the migration at all.  You have 3 hackish options

1.  Just delete the migration and update the old migration so it uses the correct column name.
2.  Insert the timestamp of the migration that you want to skip to a table called schema_migrations (not sure if this is
the exact name).  Rails basically checks this table to see which migrations need to run.
3.  Edit the migration so that it doesn't do anything, commit, deploy, run db:migrate.  Edit the migration again, commit,
deploy, run db:migrate.  The second db:migrate should not run the edited migration file.

May I ask why you decided to fix the table manually?
 
What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HLgRB17OAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HLgRB17OAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at <a href="http://jimlabs.herokuapp.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;">http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Jim ruther Nill


On Fri, Apr 28, 2017 at 9:17 AM, Joe Guerra <[hidden email]> wrote:
ok, I'm having difficulty with heroku, they are having some build problems...

I'll try later.  I guess commenting out the # rename table in change def should work?  

I was puzzled because the column title started with a capital letter, it worked fine in sqlite, but generated errors in postgres.  (so the quickest fix for me was to edit the column in postgress directly).   I belive I skipped this migration before, but I forget how I did that. 

is there anything that keeps you from using postgres for development?
 

Thanks,
Joe 

On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:


On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]> wrote:
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

If you've already fixed the table manually, then you don't need to run the migration at all.  You have 3 hackish options

1.  Just delete the migration and update the old migration so it uses the correct column name.
2.  Insert the timestamp of the migration that you want to skip to a table called schema_migrations (not sure if this is
the exact name).  Rails basically checks this table to see which migrations need to run.
3.  Edit the migration so that it doesn't do anything, commit, deploy, run db:migrate.  Edit the migration again, commit,
deploy, run db:migrate.  The second db:migrate should not run the edited migration file.

May I ask why you decided to fix the table manually?
 
What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ8y7Vf2uHq_nfSn3U%2Bk5TSwS1VhPVheRabtwgP0WFQ0dFsxaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Joe Guerra
Got it working.  I was just using the default settings that ror.  It's much easier to deal with sqlite in development.   I hate using PGAdmin for postgres.

Thanks,
Joe

On Thursday, April 27, 2017 at 7:30:10 PM UTC-4, jim wrote:


On Fri, Apr 28, 2017 at 9:17 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="640HVNzPAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
ok, I'm having difficulty with heroku, they are having some build problems...

I'll try later.  I guess commenting out the # rename table in change def should work?  

I was puzzled because the column title started with a capital letter, it worked fine in sqlite, but generated errors in postgres.  (so the quickest fix for me was to edit the column in postgress directly).   I belive I skipped this migration before, but I forget how I did that. 

is there anything that keeps you from using postgres for development?
 

Thanks,
Joe 

On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:


On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]> wrote:
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

If you've already fixed the table manually, then you don't need to run the migration at all.  You have 3 hackish options

1.  Just delete the migration and update the old migration so it uses the correct column name.
2.  Insert the timestamp of the migration that you want to skip to a table called schema_migrations (not sure if this is
the exact name).  Rails basically checks this table to see which migrations need to run.
3.  Edit the migration so that it doesn't do anything, commit, deploy, run db:migrate.  Edit the migration again, commit,
deploy, run db:migrate.  The second db:migrate should not run the edited migration file.

May I ask why you decided to fix the table manually?
 
What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at <a href="http://jimlabs.herokuapp.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;">http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="640HVNzPAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="640HVNzPAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at <a href="http://jimlabs.herokuapp.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;">http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Colin Law
On 28 April 2017 at 14:15, Joe Guerra <[hidden email]> wrote:
> Got it working.  I was just using the default settings that ror.  It's much
> easier to deal with sqlite in development.   I hate using PGAdmin for
> postgres.

Why do you have to use pgadmin? You should very rarely have to go
direct to the database.

Colin

>
> Thanks,
> Joe
>
> On Thursday, April 27, 2017 at 7:30:10 PM UTC-4, jim wrote:
>>
>>
>>
>> On Fri, Apr 28, 2017 at 9:17 AM, Joe Guerra <[hidden email]> wrote:
>>>
>>> ok, I'm having difficulty with heroku, they are having some build
>>> problems...
>>>
>>> I'll try later.  I guess commenting out the # rename table in change def
>>> should work?
>>>
>>> I was puzzled because the column title started with a capital letter, it
>>> worked fine in sqlite, but generated errors in postgres.  (so the quickest
>>> fix for me was to edit the column in postgress directly).   I belive I
>>> skipped this migration before, but I forget how I did that.
>>
>>
>> is there anything that keeps you from using postgres for development?
>>
>>>
>>>
>>> Thanks,
>>> Joe
>>>
>>> On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:
>>>>
>>>>
>>>>
>>>> On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Hi, I got stuck on a migration (basically to fix a column name).  I
>>>>> actually went into the table itself and corrected the problem.  My herkou
>>>>> migration gets stuck, and I've got other migrations behind it that aren't
>>>>> running.
>>>>
>>>>
>>>> If you've already fixed the table manually, then you don't need to run
>>>> the migration at all.  You have 3 hackish options
>>>>
>>>> 1.  Just delete the migration and update the old migration so it uses
>>>> the correct column name.
>>>> 2.  Insert the timestamp of the migration that you want to skip to a
>>>> table called schema_migrations (not sure if this is
>>>> the exact name).  Rails basically checks this table to see which
>>>> migrations need to run.
>>>> 3.  Edit the migration so that it doesn't do anything, commit, deploy,
>>>> run db:migrate.  Edit the migration again, commit,
>>>> deploy, run db:migrate.  The second db:migrate should not run the edited
>>>> migration file.
>>>>
>>>> May I ask why you decided to fix the table manually?
>>>>
>>>>>
>>>>> What should I do?
>>>>>
>>>>> Thanks,
>>>>> Joe
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Ruby on Rails: Talk" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [hidden email].
>>>>> To post to this group, send email to [hidden email].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> -------------------------------------------------------------
>>>> visit my blog at http://jimlabs.herokuapp.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> -------------------------------------------------------------
>> visit my blog at http://jimlabs.herokuapp.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtXz3O3aMMNs%2Bft2WCMEiV0rP-VNot0yNMCJGfb-LjjHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Joe Guerra
oh, right.  Just to do some minor things, but with pgadmin you have to write a bunch of sql.

On Friday, April 28, 2017 at 9:18:54 AM UTC-4, Colin Law wrote:
On 28 April 2017 at 14:15, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9akjrhX9AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">JGu...@...> wrote:
> Got it working.  I was just using the default settings that ror.  It's much
> easier to deal with sqlite in development.   I hate using PGAdmin for
> postgres.

Why do you have to use pgadmin? You should very rarely have to go
direct to the database.

Colin

>
> Thanks,
> Joe
>
> On Thursday, April 27, 2017 at 7:30:10 PM UTC-4, jim wrote:
>>
>>
>>
>> On Fri, Apr 28, 2017 at 9:17 AM, Joe Guerra <[hidden email]> wrote:
>>>
>>> ok, I'm having difficulty with heroku, they are having some build
>>> problems...
>>>
>>> I'll try later.  I guess commenting out the # rename table in change def
>>> should work?
>>>
>>> I was puzzled because the column title started with a capital letter, it
>>> worked fine in sqlite, but generated errors in postgres.  (so the quickest
>>> fix for me was to edit the column in postgress directly).   I belive I
>>> skipped this migration before, but I forget how I did that.
>>
>>
>> is there anything that keeps you from using postgres for development?
>>
>>>
>>>
>>> Thanks,
>>> Joe
>>>
>>> On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:
>>>>
>>>>
>>>>
>>>> On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Hi, I got stuck on a migration (basically to fix a column name).  I
>>>>> actually went into the table itself and corrected the problem.  My herkou
>>>>> migration gets stuck, and I've got other migrations behind it that aren't
>>>>> running.
>>>>
>>>>
>>>> If you've already fixed the table manually, then you don't need to run
>>>> the migration at all.  You have 3 hackish options
>>>>
>>>> 1.  Just delete the migration and update the old migration so it uses
>>>> the correct column name.
>>>> 2.  Insert the timestamp of the migration that you want to skip to a
>>>> table called schema_migrations (not sure if this is
>>>> the exact name).  Rails basically checks this table to see which
>>>> migrations need to run.
>>>> 3.  Edit the migration so that it doesn't do anything, commit, deploy,
>>>> run db:migrate.  Edit the migration again, commit,
>>>> deploy, run db:migrate.  The second db:migrate should not run the edited
>>>> migration file.
>>>>
>>>> May I ask why you decided to fix the table manually?
>>>>
>>>>>
>>>>> What should I do?
>>>>>
>>>>> Thanks,
>>>>> Joe
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Ruby on Rails: Talk" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to rubyonrails-ta...@googlegroups.com.
>>>>> To post to this group, send email to [hidden email].
>>>>> To view this discussion on the web visit
>>>>> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
>>>>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> -------------------------------------------------------------
>>>> visit my blog at <a href="http://jimlabs.herokuapp.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;">http://jimlabs.herokuapp.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to rubyonrails-ta...@googlegroups.com.
>>> To post to this group, send email to [hidden email].
>>> To view this discussion on the web visit
>>> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.
>>>
>>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> -------------------------------------------------------------
>> visit my blog at <a href="http://jimlabs.herokuapp.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjimlabs.herokuapp.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFK7b3kRhtChcrLVw_euLE1USIeMw&#39;;return true;">http://jimlabs.herokuapp.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9akjrhX9AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9akjrhX9AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/7476074e-9b38-4d0c-8c09-cc8320e689e3%40googlegroups.com.
>
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0bcd9ba2-e6ca-47e0-bfc9-779d222ab336%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: migration problems

Colin Law


On 29 Apr 2017 3:05 a.m., "Joe Guerra" <[hidden email]> wrote:
oh, right.  Just to do some minor things, but with pgadmin you have to write a bunch of sql.

What sort of minor things? Often you can do things from the rails console.


On Friday, April 28, 2017 at 9:18:54 AM UTC-4, Colin Law wrote:
On 28 April 2017 at 14:15, Joe Guerra <[hidden email]> wrote:
> Got it working.  I was just using the default settings that ror.  It's much
> easier to deal with sqlite in development.   I hate using PGAdmin for
> postgres.

Why do you have to use pgadmin? You should very rarely have to go
direct to the database.

Colin

>
> Thanks,
> Joe
>
> On Thursday, April 27, 2017 at 7:30:10 PM UTC-4, jim wrote:
>>
>>
>>
>> On Fri, Apr 28, 2017 at 9:17 AM, Joe Guerra <[hidden email]> wrote:
>>>
>>> ok, I'm having difficulty with heroku, they are having some build
>>> problems...
>>>
>>> I'll try later.  I guess commenting out the # rename table in change def
>>> should work?
>>>
>>> I was puzzled because the column title started with a capital letter, it
>>> worked fine in sqlite, but generated errors in postgres.  (so the quickest
>>> fix for me was to edit the column in postgress directly).   I belive I
>>> skipped this migration before, but I forget how I did that.
>>
>>
>> is there anything that keeps you from using postgres for development?
>>
>>>
>>>
>>> Thanks,
>>> Joe
>>>
>>> On Thursday, April 27, 2017 at 7:02:48 PM UTC-4, jim wrote:
>>>>
>>>>
>>>>
>>>> On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Hi, I got stuck on a migration (basically to fix a column name).  I
>>>>> actually went into the table itself and corrected the problem.  My herkou
>>>>> migration gets stuck, and I've got other migrations behind it that aren't
>>>>> running.
>>>>
>>>>
>>>> If you've already fixed the table manually, then you don't need to run
>>>> the migration at all.  You have 3 hackish options
>>>>
>>>> 1.  Just delete the migration and update the old migration so it uses
>>>> the correct column name.
>>>> 2.  Insert the timestamp of the migration that you want to skip to a
>>>> table called schema_migrations (not sure if this is
>>>> the exact name).  Rails basically checks this table to see which
>>>> migrations need to run.
>>>> 3.  Edit the migration so that it doesn't do anything, commit, deploy,
>>>> run db:migrate.  Edit the migration again, commit,
>>>> deploy, run db:migrate.  The second db:migrate should not run the edited
>>>> migration file.
>>>>
>>>> May I ask why you decided to fix the table manually?
>>>>
>>>>>
>>>>> What should I do?
>>>>>
>>>>> Thanks,
>>>>> Joe
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Ruby on Rails: Talk" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to rubyonrails-ta...@googlegroups.com.
>>>>> To post to this group, send email to [hidden email].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> -------------------------------------------------------------
>>>> visit my blog at http://jimlabs.herokuapp.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to rubyonrails-ta...@googlegroups.com.
>>> To post to this group, send email to [hidden email].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/f4266b4f-c569-4820-891f-2e7ba8a89126%40googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> -------------------------------------------------------------
>> visit my blog at http://jimlabs.herokuapp.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0bcd9ba2-e6ca-47e0-bfc9-779d222ab336%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvrEinZOh9U6eYcoh2VwMOEEz%3DdaiO3ksfmWnkr7ULdUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.