Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion lfs_migrate detecting bad version

Date: Tue, 22 May 2012 13:52:11 -0700 (PDT)
From: =?UTF-8?Q?Martin_Tir=C5=A1el?= <konf...@blackpage.eu>
To: django-lfs@googlegroups.com
Message-Id: <a0053e50-cca1-4d3b-ab34-5e9d9555937f@googlegroups.com>
In-Reply-To: <bc3a7ef9-f4da-4225-91d4-6d095e694ed9@8g2000vbu.googlegroups.com>
References: <30459695.1344.1337201966846.JavaMail.geo-discussion-forums@ynbq3>
 <bc3a7ef9-f4da-4225-91d4-6d095e694ed9@8g2000vbu.googlegroups.com>
Subject: Re: lfs_migrate detecting bad version
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1012_12704113.1337719931381"

------=_Part_1012_12704113.1337719931381
Content-Type: multipart/alternative; 
	boundary="----=_Part_1013_11176474.1337719931381"

------=_Part_1013_11176474.1337719931381
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

thanks I tried to migrate production server with the same code and I got=20
still some errors. I had working 0.6 version with some setup and tried now=
=20
to migrate to 0.7:

* upgraded python packages with pip command (lfs to 0.6.x -> 0.7.4, django=
=20
1.3->1.4, ...)
* ran ../manage.py syncdb:

Syncing...
Creating tables ...
Creating table south_migrationhistory
Creating table catalog_productattachment
Creating table portlet_forsaleportlet
Creating table portlet_featuredportlet
Creating table customer_tax_customertax_countries
Creating table customer_tax_customertax
Creating table lfs_order_numbers_ordernumbergenerator
The following content types are stale and need to be deleted:

auth | message

Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.

Type 'yes' to continue, or 'no' to cancel: yes
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
> predajsperkov.sitetheme
> compressor
> django.contrib.admin
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.staticfiles
> django.contrib.sites
> django.contrib.flatpages
> django.contrib.redirects
> django.contrib.sitemaps
> djangorestframework
> django_countries
> south
> debug_toolbar
> pagination
> reviews
> sorl.thumbnail
> tagging
> portlets
> lfs.core
> lfs.cart
> lfs.catalog
> lfs.checkout
> lfs.criteria
> lfs.customer
> lfs.discounts
> lfs.export
> lfs.gross_price
> lfs.integrationtests
> lfs.marketing
> lfs.manufacturer
> lfs.net_price
> lfs.order
> lfs.page
> lfs.payment
> lfs.portlet
> lfs.search
> lfs.shipping
> lfs.supplier
> lfs.tax
> lfs.customer_tax
> lfs.voucher
> lfs_order_numbers
> postal

Not synced (use migrations):
- paypal.standard.ipn
- paypal.standard.pdt


* lfs_migrate:

../manage.py lfs_migrate
Detected version: 0.6
Traceback (most recent call last):
File "../manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/managemen=
t/__init__.py",=20
line 443, in execute_from_command_line
utility.execute()
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/managemen=
t/__init__.py",=20
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/managemen=
t/base.py",=20
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/managemen=
t/base.py",=20
line 232, in execute
output =3D self.handle(*args, **options)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/lfs/core/management/c=
ommands/lfs_migrate.py",=20
line 40, in handle
self.migrate_to_07(application, version)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/lfs/core/management/c=
ommands/lfs_migrate.py",=20
line 58, in migrate_to_07
db.add_column("catalog_product", "type_of_quantity_field",=20
models.PositiveSmallIntegerField(_(u"Type of quantity field"), null=3DTrue,=
=20
blank=3DTrue, choices=3DQUANTITY_FIELD_TYPES))
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/south/db/generic.py",=
=20
line 282, in add_column
self.execute(sql)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/south/db/generic.py",=
=20
line 150, in execute
cursor.execute(sql, params)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/db/backends/ut=
il.py",=20
line 40, in execute
return self.cursor.execute(sql, params)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/db/backends/my=
sql/base.py",=20
line 114, in execute
return self.cursor.execute(query, args)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/MySQLdb/cursors.py",=
=20
line 174, in execute
self.errorhandler(self, exc, value)
File=20
"/var/www/.virtualenv/lfs/lib/python2.6/site-packages/MySQLdb/connections.p=
y",=20
line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.DatabaseError: (1060, "Duplicate column name=20
'type_of_quantity_field'")

Thanks,
Martin


On Wednesday, May 16, 2012 11:26:12 PM UTC+2, Kai Diefenbach wrote:
>
> Hi Martin,=20
>
> On 16 Mai, 22:59, Martin Tir=C5=A1el <konf...@blackpage.eu> wrote:=20
> > is it bug or I have done something wrong? I had version 0.6.x, some day=
s=20
> > ago I upgraded to version 0.7.2 but the migration failed, so I destroye=
d=20
> > the database and made empty database and lfs_init. Today I upgraded fro=
m=20
> > 0.7.2 to 0.7.3, ran lfs_migrate and got:=20
>
> First of all, you don't need to migrate from 0.7.2 to 0.7.3. If you=20
> ran the installation from 0.7.2 properly:=20
>
>     http://docs.getlfs.com/en/latest/introduction/installation.html#id1=
=20
>
> and then execute lfs_migrate on 0.7.3 you should get:=20
>
>     $ bin/django lfs_migrate=20
>     Detected version: 0.7=20
>     You are up-to-date=20
>
> I've just tried it here and it works. I assume you haven't run=20
> lfs_init on 0.7.2.=20
>
> > Second thing, I can not uncheck Active base price in product data. Afte=
r=20
> > unchecking and saving I have the box checked again.=20
>
> Thanks for reporting this. It is already fixed within the repository,=20
> see:=20
>
>    =20
> https://github.com/diefenbach/django-lfs/commit/18cb4918ee881b852f8c0d3e8=
d7cdebb00cb7c30=20
>
> This will be part of the next release, presumably the at upcoming=20
> weekend.=20
>
> Regards=20
> Kai


------=_Part_1013_11176474.1337719931381
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div>Hi,<br></div><div><br></div><div>thanks I tried to migrate production =
server with the same code and I got still some errors. I had working 0.6 ve=
rsion with some setup and tried now to migrate to 0.7:</div><div><br></div>=
<div>* upgraded python packages with pip command (lfs to 0.6.x -&gt; 0.7.4,=
 django 1.3-&gt;1.4, ...)</div><div>* ran ../manage.py syncdb:</div><div><b=
r><font face=3D"courier new,monospace">Syncing...<br>Creating tables ...<br=
>Creating table south_migrationhistory<br>Creating table catalog_productatt=
achment<br>Creating table portlet_forsaleportlet<br>Creating table portlet_=
featuredportlet<br>Creating table customer_tax_customertax_countries<br>Cre=
ating table customer_tax_customertax<br>Creating table lfs_order_numbers_or=
dernumbergenerator<br>The following content types are stale and need to be =
deleted:<br><br>    auth | message<br><br>Any objects related to these cont=
ent types by a foreign key will also<br>be deleted. Are you sure you want t=
o delete these content types?<br>If you're unsure, answer 'no'.<br><br>    =
Type 'yes' to continue, or 'no' to cancel: yes<br>Installing custom SQL ...=
<br>Installing indexes ...<br>Installed 0 object(s) from 0 fixture(s)<br><b=
r>Synced:<br> &gt; predajsperkov.sitetheme<br> &gt; compressor<br> &gt; dja=
ngo.contrib.admin<br> &gt; django.contrib.auth<br> &gt; django.contrib.cont=
enttypes<br> &gt; django.contrib.sessions<br> &gt; django.contrib.staticfil=
es<br> &gt; django.contrib.sites<br> &gt; django.contrib.flatpages<br> &gt;=
 django.contrib.redirects<br> &gt; django.contrib.sitemaps<br> &gt; djangor=
estframework<br> &gt; django_countries<br> &gt; south<br> &gt; debug_toolba=
r<br> &gt; pagination<br> &gt; reviews<br> &gt; sorl.thumbnail<br> &gt; tag=
ging<br> &gt; portlets<br> &gt; lfs.core<br> &gt; lfs.cart<br> &gt; lfs.cat=
alog<br> &gt; lfs.checkout<br> &gt; lfs.criteria<br> &gt; lfs.customer<br> =
&gt; lfs.discounts<br> &gt; lfs.export<br> &gt; lfs.gross_price<br> &gt; lf=
s.integrationtests<br> &gt; lfs.marketing<br> &gt; lfs.manufacturer<br> &gt=
; lfs.net_price<br> &gt; lfs.order<br> &gt; lfs.page<br> &gt; lfs.payment<b=
r> &gt; lfs.portlet<br> &gt; lfs.search<br> &gt; lfs.shipping<br> &gt; lfs.=
supplier<br> &gt; lfs.tax<br> &gt; lfs.customer_tax<br> &gt; lfs.voucher<br=
> &gt; lfs_order_numbers<br> &gt; postal<br><br>Not synced (use migrations)=
:<br> - paypal.standard.ipn<br> - paypal.standard.pdt</font><br></div><div>=
<br></div><div><br></div><div>* lfs_migrate:</div><div><br></div><div><font=
 face=3D"courier new,monospace">../manage.py lfs_migrate<br>Detected versio=
n: 0.6<br>Traceback (most recent call last):<br>  File "../manage.py", line=
 10, in &lt;module&gt;<br>    execute_from_command_line(sys.argv)<br>  File=
 "/var/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/manageme=
nt/__init__.py", line 443, in execute_from_command_line<br>    utility.exec=
ute()<br>  File "/var/www/.virtualenv/lfs/lib/python2.6/site-packages/djang=
o/core/management/__init__.py", line 382, in execute<br>    self.fetch_comm=
and(subcommand).run_from_argv(self.argv)<br>  File "/var/www/.virtualenv/lf=
s/lib/python2.6/site-packages/django/core/management/base.py", line 196, in=
 run_from_argv<br>    self.execute(*args, **options.__dict__)<br>  File "/v=
ar/www/.virtualenv/lfs/lib/python2.6/site-packages/django/core/management/b=
ase.py", line 232, in execute<br>    output =3D self.handle(*args, **option=
s)<br>  File "/var/www/.virtualenv/lfs/lib/python2.6/site-packages/lfs/core=
/management/commands/lfs_migrate.py", line 40, in handle<br>    self.migrat=
e_to_07(application, version)<br>  File "/var/www/.virtualenv/lfs/lib/pytho=
n2.6/site-packages/lfs/core/management/commands/lfs_migrate.py", line 58, i=
n migrate_to_07<br>    db.add_column("catalog_product", "type_of_quantity_f=
ield", models.PositiveSmallIntegerField(_(u"Type of quantity field"), null=
=3DTrue, blank=3DTrue, choices=3DQUANTITY_FIELD_TYPES))<br>  File "/var/www=
/.virtualenv/lfs/lib/python2.6/site-packages/south/db/generic.py", line 282=
, in add_column<br>    self.execute(sql)<br>  File "/var/www/.virtualenv/lf=
s/lib/python2.6/site-packages/south/db/generic.py", line 150, in execute<br=
>    cursor.execute(sql, params)<br>  File "/var/www/.virtualenv/lfs/lib/py=
thon2.6/site-packages/django/db/backends/util.py", line 40, in execute<br> =
   return self.cursor.execute(sql, params)<br>  File "/var/www/.virtualenv/=
lfs/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 114=
, in execute<br>    return self.cursor.execute(query, args)<br>  File "/var=
/www/.virtualenv/lfs/lib/python2.6/site-packages/MySQLdb/cursors.py", line =
174, in execute<br>    self.errorhandler(self, exc, value)<br>  File "/var/=
www/.virtualenv/lfs/lib/python2.6/site-packages/MySQLdb/connections.py", li=
ne 36, in defaulterrorhandler<br>    raise errorclass, errorvalue<br>django=
.db.utils.DatabaseError: (1060, "Duplicate column name 'type_of_quantity_fi=
eld'")</font></div><div><br></div><div>Thanks,</div><div>Martin</div><div><=
br></div><div><br></div>On Wednesday, May 16, 2012 11:26:12 PM UTC+2, Kai D=
iefenbach wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi Martin,
<br>
<br>On 16 Mai, 22:59, Martin Tir=C5=A1el &lt;<a>konf...@blackpage.eu</a>&gt=
; wrote:
<br>&gt; is it bug or I have done something wrong? I had version 0.6.x, som=
e days
<br>&gt; ago I upgraded to version 0.7.2 but the migration failed, so I des=
troyed
<br>&gt; the database and made empty database and lfs_init. Today I upgrade=
d from
<br>&gt; 0.7.2 to 0.7.3, ran lfs_migrate and got:
<br>
<br>First of all, you don't need to migrate from 0.7.2 to 0.7.3. If you
<br>ran the installation from 0.7.2 properly:
<br>
<br>&nbsp; &nbsp; <a href=3D"http://docs.getlfs.com/en/latest/introduction/=
installation.html#id1" target=3D"_blank">http://docs.getlfs.com/en/latest/i=
ntroduction/installation.html#id1</a>
<br>
<br>and then execute lfs_migrate on 0.7.3 you should get:
<br>
<br>&nbsp; &nbsp; $ bin/django lfs_migrate
<br>&nbsp; &nbsp; Detected version: 0.7
<br>&nbsp; &nbsp; You are up-to-date
<br>
<br>I've just tried it here and it works. I assume you haven't run
<br>lfs_init on 0.7.2.
<br>
<br>&gt; Second thing, I can not uncheck Active base price in product data.=
 After
<br>&gt; unchecking and saving I have the box checked again.
<br>
<br>Thanks for reporting this. It is already fixed within the repository,
<br>see:
<br>
<br>&nbsp; &nbsp; <a href=3D"https://github.com/diefenbach/django-lfs/commi=
t/18cb4918ee881b852f8c0d3e8d7cdebb00cb7c30" target=3D"_blank">https://githu=
b.com/diefenbach/django-lfs/commit/18cb4918ee881b852f8c0d3e8d7cdebb00cb7c30=
</a>
<br>
<br>This will be part of the next release, presumably the at upcoming
<br>weekend.
<br>
<br>Regards
<br>Kai</blockquote>
------=_Part_1013_11176474.1337719931381--

------=_Part_1012_12704113.1337719931381--