Re: Adding a field to a model after initial migration

2016-01-29 Thread Guan Ke
When you run makemigrations command, Django will compare your current model module with the newest migration module. You should have a look at your 0002_signup_updated... file to find out what cause the problem. On Thursday, January 28, 2016 at 3:21:16 AM UTC+8, ofeyofey wrote: > > Hi, > I forgo

Re: Adding a field to a model after initial migration

2016-01-28 Thread Daniel Roseman
On Wednesday, 27 January 2016 21:29:18 UTC, ofeyofey wrote: > > No problem. Thanks for your help. > Maybe fields can't be added to a model with django. > I will try dropping the table in the DB and see what happens. > Thanks again, > Adding fields to models is quite literally what migrations are f

Re: Adding a field to a model after initial migration

2016-01-27 Thread ofeyofey
Alas too late... I have dropped the table. But this link http://www.djangobook.com/en/2.0/chapter10.html to a Django Book for version 1.0 may hold some ideas under the section about adding fields. Thanks On Wednesday, 27 January 2016 19:21:16 UTC, ofeyofey wrote: > > Hi, > I forgot to add a field

Re: Adding a field to a model after initial migration

2016-01-27 Thread sum abiut
You should try running it as root. On Thu, Jan 28, 2016 at 8:29 AM, ofeyofey wrote: > No problem. Thanks for your help. > Maybe fields can't be added to a model with django. > I will try dropping the table in the DB and see what happens. > Thanks again, > > On Wednesday, 27 January 2016 19:21:16

Re: Adding a field to a model after initial migration

2016-01-27 Thread ofeyofey
No problem. Thanks for your help. Maybe fields can't be added to a model with django. I will try dropping the table in the DB and see what happens. Thanks again, On Wednesday, 27 January 2016 19:21:16 UTC, ofeyofey wrote: > > Hi, > I forgot to add a field to a model and wish to add it now. > I add

Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
i dont know why sorry..try default value Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey έγραψε: > > Hi, > I forgot to add a field to a model and wish to add it now. > I added the line to models.py but makemigrations and migrate aren't > working now. > Is this possible in

Re: Adding a field to a model after initial migration

2016-01-27 Thread ofeyofey
Ok I put the app name which is 'news' after the commands for makemigrations and for migrate. But I am still getting the same results. On Wednesday, 27 January 2016 19:21:16 UTC, ofeyofey wrote: > > Hi, > I forgot to add a field to a model and wish to add it now. > I added the line to models.py bu

Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
you add your app name after the run makemigration and migrate ?if your app name is a blog then you run* makemigration blog *and *migrate blog* Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey έγραψε: > > Hi, > I forgot to add a field to a model and wish to add it now. > I

Re: Adding a field to a model after initial migration

2016-01-27 Thread ofeyofey
Hi, I changed the line to updated = models.DateTimeField(auto_now_add = False, auto_now = True, null= True) But the same results, [pi@Huawei-HG658c-instalacion src]$ python manage.py makemigrations /home/pi/src/djangoTest/urls.py:20: RemovedInDjango110Warning: Support for string view argumen

Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
work now ? Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey έγραψε: > > Hi, > I forgot to add a field to a model and wish to add it now. > I added the line to models.py but makemigrations and migrate aren't > working now. > Is this possible in Django or do i need to go dir

Re: Adding a field to a model after initial migration

2016-01-27 Thread ofeyofey
Thanks for your reply. The model.py contains, class SignUp(models.Model): email = models.EmailField() full_name = models.CharField(max_length = 120, blank = True, null = True) timestamp = models.DateTimeField(auto_now_add = True, auto_now = False) updated = models.DateTimeField(

Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
no the problem is your new field affect models rules...try the new field to have null=True or default=somathing and then run on mynage.py makemigration yourapp and after migrate yourapp christos Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey έγραψε: > > Hi, > I forgot

Re: Adding a field to a model after initial migration

2016-01-27 Thread sum abiut
What error did your get? what command did you use? try python manage.py makemigrations python manage.py migrate On Wed, Jan 27, 2016 at 11:21 AM, ofeyofey wrote: > Hi, > I forgot to add a field to a model and wish to add it now. > I added the line to models.py but makemigrations and migrate are

Re: Adding a field to a model

2007-03-24 Thread James Bennett
On 3/24/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > (3) At your database prompt ("manage.py shell" and go from there), > execute "ALTER TABLE ADD COLUMN ... DEFAULT ...", filling in the first > "..." part with the column definition you noted before. You will also > need to add a DEFAULT va

Re: Adding a field to a model

2007-03-24 Thread Malcolm Tredinnick
On Sat, 2007-03-24 at 18:04 -0700, Mark Engelberg wrote: > I know that, unfortunately, there's no painless way to migrate all the > data in your database when you add a new optional field to your model. > Pity. > > So what is the MOST painless way to do this? (1) Add the field to your model. (

Re: Adding a field to a model

2007-03-24 Thread John M
I think the new .96 version has a export / import data function now. On Mar 24, 6:04 pm, "Mark Engelberg" <[EMAIL PROTECTED]> wrote: > I know that, unfortunately, there's no painless way to migrate all the > data in your database when you add a new optional field to your model. > Pity. > > So wh