pythondotorg icon indicating copy to clipboard operation
pythondotorg copied to clipboard

Unable to execute migrate against checkout repository

Open originalankur opened this issue 12 years ago • 3 comments

python3.3 manage.py migrate Running migrations for django_comments_xtd:

  • Nothing to migrate.
    • Loading initial data for django_comments_xtd. Installed 0 object(s) from 0 fixture(s) Running migrations for sitetree:
  • Nothing to migrate.
    • Loading initial data for sitetree. Installed 0 object(s) from 0 fixture(s) Running migrations for boxes:
    • Migrating forwards to 0003_auto__add_index_box_created.

      boxes:0001_initial FATAL ERROR - The following SQL query failed: ALTER TABLE "boxes_box" ADD CONSTRAINT "creator_id_refs_id_6d6abbed" FOREIGN KEY ("creator_id") REFERENCES "users_user" ("id") DEFERRABLE INITIALLY DEFERRED; The error was: relation "users_user" does not exist

Error in migration: boxes:0001_initial DatabaseError: relation "users_user" does not exist

originalankur avatar Feb 27 '14 17:02 originalankur

Please note that syncdb was executed. Against which commit can I be assured that migrate would work ?. I could checkout the same and do git pull from there ?

originalankur avatar Feb 27 '14 18:02 originalankur

@versesane can you confirm if 4084b05 fixed the issue?

fcurella avatar Feb 27 '14 18:02 fcurella

Flavio,

Can confirm that https://github.com/python/pythondotorg/commit/4084b05 has fixed the issue.

Also note the following the packages / step were needed on ubuntu 13.10

$ wget http://anonscm.debian.org/loggerhead/pkg-postgresql/postgresql-common/trunk/download/head:/apt.postgresql.org.s-20130224224205-px3qyst90b3xp8zj-1/apt.postgresql.org.sh

$ chmod 777 apt.postgresql.org.sh $ sudo ./apt.postgresql.org.sh $ apt-cache search postgresql-9.3 $ apt-cache search postgresql-9.3-dev $ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3 $ sudo su postgres $ psql $ psql python.org $ sudo /etc/init.d/postgresql restart $ sudo apt-get install git $ git clone https://github.com/python/pythondotorg.git $ curl http://python-distribute.org/distribute_setup.py | sudo python3.3 $ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python3.3 $ rm distribute-0.6.49.tar.gz $ pip3.3 install -r requirements.txt $ sudo apt-get install python3-dev $ sudo apt-get install libxml2-dev libxslt-dev python-lxml $ pyvenv-3.3 ../env $ source ../env/bin/activate $ export DATABASE_URL=postgres://go:go@localhost/python.org $ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev $ curl -L https://get.rvm.io | bash -s stable $ source ~/.rvm/scripts/rvm $ rvm requirements $ rvm install ruby $ gem install bundler $ bundle install $ python3.3m manage.py syncdb $ export LC_CTYPE=en_US.UTF-8 $ export LC_ALL=en_US.UTF-8 $ python3.3m manage.py migrate $ python3.3m manage.py createsuperuser $ find ./fixtures -name "*.json" -exec python3.3m manage.py loaddata {} ;

originalankur avatar Mar 01 '14 11:03 originalankur