Modify

Ticket #332 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Postgres ProgrammingError: constraint does not exist on Postgres 8.1.8 -- works fine on later versions

Reported by: DrMeers@… Owned by: andrew
Priority: major Milestone: 0.7
Component: commands Version: 0.6.2
Keywords: Cc:

Attachments

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.7

Apologies for my very slow reply, it's been a busy week.

Considering that postgres 8.1 is now five years old, and I have virtually no way to install it on my dev machine, this seems to be a hard one to solve. The best place to start is by running the migration with --verbosity=2, to see what SQL the command is actually trying to run.

I'd wager something has changed since 8.1's handling of constraints.

comment:2 Changed 4 years ago by michael@…

Hello and thanks. I'm the guy that started that email thread kindly linked-to by DrMeers?.

Please note that 8.1 is the standard shipping version with the latest RHEL 5.4. That's what my hosting provider uses (hostmonster.com) so while it is indeed quite old it is evidently not obsolete :-)

Anyways, here's a re-run with verbosity=2 and uncommenting a couple of the statements failing statements. It does indeed appear to have something to do with constraints.


Running migrations for file:

  • Migrating forwards to 0005_publisher2.

    file: 0004_table_rename

ALTER TABLE "file_file" RENAME TO "cmsplugin_file"; []

ALTER TABLE "file_file_id_seq" RENAME TO "cmsplugin_file_id_seq"; []

~ No such sequence (ignoring error)

ALTER TABLE "file_file_pkey" RENAME TO "cmsplugin_file_pkey"; []

~ No such primary key (ignoring error)

ALTER TABLE "file_publicfile" RENAME TO "cmsplugin_filepublic"; []

ALTER TABLE "file_publicfile_id_seq" RENAME TO "cmsplugin_filepublic_id_seq"; []

~ No such sequence (ignoring error)

ALTER TABLE "file_publicfile_pkey" RENAME TO "cmsplugin_filepublic_pkey"; []

=

SELECT kc.constraint_name, kc.column_name
FROM information_schema.constraint_column_usage AS kc
JOIN information_schema.table_constraints AS c ON

kc.table_schema = c.table_schema AND
kc.table_name = c.table_name AND
kc.constraint_name = c.constraint_name

WHERE

kc.table_schema = %s AND
kc.table_name = %s AND
c.constraint_type = %s

['public', 'cmsplugin_file', 'CHECK']

ALTER TABLE "cmsplugin_file" ALTER COLUMN "public_id" TYPE integer, ALTER COLUMN "public_id" DROP DEFAULT, ALTER COLUMN "public_id" DROP NOT NULL; []

=

SELECT kc.constraint_name, kc.column_name
FROM information_schema.key_column_usage AS kc
JOIN information_schema.table_constraints AS c ON

kc.table_schema = c.table_schema AND
kc.table_name = c.table_name AND
kc.constraint_name = c.constraint_name

WHERE

kc.table_schema = %s AND
kc.table_name = %s AND
c.constraint_type = %s

['public', 'cmsplugin_file', 'FOREIGN KEY']

ALTER TABLE "cmsplugin_file" DROP CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_77b9e3de98592d4c" []

ALTER TABLE "cmsplugin_filepublic" DROP CONSTRAINT "cmsplugin_filepublic_pkey" []

Traceback (most recent call last):

File "manage.py", line 13, in <module>

execute_manager(settings)

File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/init.py", line 362, in execute_manager

utility.execute()

File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/init.py", line 303, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv

self.execute(*args, options.dict)

File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/base.py", line 222, in execute

output = self.handle(*args, options)

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/management/commands/migrate.py", line 91, in handle

skip = skip,

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 581, in migrate_app

result = run_forwards(mapp, [mname], fake=fake, db_dry_run=db_dry_run, verbosity=verbosity)

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 388, in run_forwards

verbosity = verbosity,

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 329, in run_migrations

runfunc(orm)

File "/home/redmulec/python/lib/python2.6/site-packages/django_cms-2.1.0.alpha-py2.6.egg/cms/plugins/file/migrations/0004_table_rename.py", line 19, in forwards

db.drop_primary_key("cmsplugin_filepublic")

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/db/generic.py", line 597, in drop_primary_key

"constraint": qn(table_name+"_pkey"),

File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/db/generic.py", line 86, in execute

cursor.execute(sql, params)

psycopg2.ProgrammingError?: constraint "cmsplugin_filepublic_pkey" does not exist

comment:3 Changed 4 years ago by anonymous

Sorry. I'm resubmitting that with a code block to perhaps make it more readable.

Running migrations for file:
 - Migrating forwards to 0005_publisher2.
 > file: 0004_table_rename
   = ALTER TABLE "file_file" RENAME TO "cmsplugin_file"; []
   = ALTER TABLE "file_file_id_seq" RENAME TO "cmsplugin_file_id_seq"; []
   ~ No such sequence (ignoring error)
   = ALTER TABLE "file_file_pkey" RENAME TO "cmsplugin_file_pkey"; []
   ~ No such primary key (ignoring error)
   = ALTER TABLE "file_publicfile" RENAME TO "cmsplugin_filepublic"; []
   = ALTER TABLE "file_publicfile_id_seq" RENAME TO "cmsplugin_filepublic_id_seq"; []
   ~ No such sequence (ignoring error)
   = ALTER TABLE "file_publicfile_pkey" RENAME TO "cmsplugin_filepublic_pkey"; []
   =
            SELECT kc.constraint_name, kc.column_name
            FROM information_schema.constraint_column_usage AS kc
            JOIN information_schema.table_constraints AS c ON
                kc.table_schema = c.table_schema AND
                kc.table_name = c.table_name AND
                kc.constraint_name = c.constraint_name
            WHERE
                kc.table_schema = %s AND
                kc.table_name = %s AND
                c.constraint_type = %s
         ['public', 'cmsplugin_file', 'CHECK']
   = ALTER TABLE "cmsplugin_file" ALTER COLUMN "public_id" TYPE integer, ALTER COLUMN "public_id" DROP DEFAULT, ALTER COLUMN "public_id" DROP NOT NULL; []
   =
            SELECT kc.constraint_name, kc.column_name
            FROM information_schema.key_column_usage AS kc
            JOIN information_schema.table_constraints AS c ON
                kc.table_schema = c.table_schema AND
                kc.table_name = c.table_name AND
                kc.constraint_name = c.constraint_name
            WHERE
                kc.table_schema = %s AND
                kc.table_name = %s AND
                c.constraint_type = %s
         ['public', 'cmsplugin_file', 'FOREIGN KEY']
   = ALTER TABLE "cmsplugin_file" DROP CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_77b9e3de98592d4c" []
   = ALTER TABLE "cmsplugin_filepublic" DROP CONSTRAINT "cmsplugin_filepublic_pkey" []
Traceback (most recent call last):
  File "manage.py", line 13, in <module>
    execute_manager(settings)
  File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
  File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/redmulec/python/lib/python2.6/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/management/commands/migrate.py", line 91, in handle
    skip = skip,
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 581, in migrate_app
    result = run_forwards(mapp, [mname], fake=fake, db_dry_run=db_dry_run, verbosity=verbosity)
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 388, in run_forwards
    verbosity = verbosity,
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/migration.py", line 329, in run_migrations
    runfunc(orm)
  File "/home/redmulec/python/lib/python2.6/site-packages/django_cms-2.1.0.alpha-py2.6.egg/cms/plugins/file/migrations/0004_table_rename.py", line 19, in forwards
    db.drop_primary_key("cmsplugin_filepublic")
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/db/generic.py", line 597, in drop_primary_key
    "constraint": qn(table_name+"_pkey"),
  File "/home/redmulec/python/lib/python2.6/site-packages/South-0.6.2-py2.6.egg/south/db/generic.py", line 86, in execute
    cursor.execute(sql, params)
psycopg2.ProgrammingError: constraint "cmsplugin_filepublic_pkey" does not exist


comment:4 Changed 4 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in [27347e319b13] (0.6 branch) and [8de2e9af5ca6] (0.7 branch).

I'd hardcoded the DROP PRIMARY KEY code for postgres to guess that the constraint was field_name + "_pkey". Turns out, this is why I wrote the constraint name detector :)

comment:5 Changed 4 years ago by tjurewicz@…

I am seeing this same behavior with the exact error messages on Postgres 8.4.3, South 0.7.1, Django 1.2.1, and the trunk checkout of django-cms.

comment:6 Changed 4 years ago by anonymous

Here is the output of --verbosity=2:

	Running migrations for cms:
	 - Migrating forwards to 0027_added_width_to_placeholder.
	 > cms:0001_initial
	   = CREATE TABLE "cms_cmsplugin" ("language" varchar(3) NOT NULL, "page_id" integer NOT NULL, "position" smallint CHECK ("position" >= 0) NOT NULL DEFAULT 0, "creation_date" timestamp with time zone NOT NULL DEFAULT '2010-06-07 17:58:32.355884', "placeholder" varchar(50) NOT NULL, "id" serial NOT NULL PRIMARY KEY, "plugin_type" varchar(50) NOT NULL); []
	   = CREATE TABLE "cms_title" ("language" varchar(3) NOT NULL, "title" varchar(255) NOT NULL, "page_id" integer NOT NULL, "id" serial NOT NULL PRIMARY KEY, "path" varchar(255) NOT NULL, "creation_date" timestamp with time zone NOT NULL DEFAULT '2010-06-07 17:58:32.386163', "slug" varchar(255) NOT NULL); []
	   = CREATE TABLE "cms_pagepermission" ("everybody" boolean NOT NULL DEFAULT False, "can_edit" boolean NOT NULL DEFAULT True, "group_id" integer NULL, "can_publish" boolean NOT NULL DEFAULT True, "page_id" integer NULL, "user_id" integer NULL, "type" integer NOT NULL DEFAULT 0, "id" serial NOT NULL PRIMARY KEY, "can_change_softroot" boolean NOT NULL DEFAULT False); []
	   = CREATE TABLE "cms_page" ("status" integer NOT NULL DEFAULT 0, "rght" integer CHECK ("rght" >= 0) NOT NULL, "level" integer CHECK ("level" >= 0) NOT NULL, "navigation_extenders" varchar(80) NULL, "has_url_overwrite" boolean NOT NULL DEFAULT False, "url_overwrite" varchar(80) NULL, "parent_id" integer NULL, "author_id" integer NOT NULL, "reverse_id" varchar(40) NULL, "login_required" boolean NOT NULL DEFAULT False, "soft_root" boolean NOT NULL DEFAULT False, "creation_date" timestamp with time zone NOT NULL DEFAULT '2010-06-07 17:58:32.404965', "lft" integer CHECK ("lft" >= 0) NOT NULL, "publication_end_date" timestamp with time zone NULL, "template" varchar(100) NOT NULL, "tree_id" integer CHECK ("tree_id" >= 0) NOT NULL, "publication_date" timestamp with time zone NULL, "in_navigation" boolean NOT NULL DEFAULT True, "id" serial NOT NULL PRIMARY KEY); []
	   = CREATE TABLE "cms_placeholder" ("body" text NOT NULL, "language" varchar(3) NOT NULL, "id" serial NOT NULL PRIMARY KEY, "name" varchar(50) NOT NULL, "page_id" integer NOT NULL); []
	   = CREATE TABLE "cms_page_sites" ("id" serial NOT NULL PRIMARY KEY, "page_id" integer NOT NULL, "site_id" integer NOT NULL); []
	   = CREATE INDEX "cms_cmsplugin_language" ON "cms_cmsplugin" ("language"); []
	   = CREATE INDEX "cms_cmsplugin_language_like" ON "cms_cmsplugin" ("language" varchar_pattern_ops); []
	   = ALTER TABLE "cms_cmsplugin" ADD CONSTRAINT "page_id_refs_id_a9b9f07acd5bfb9" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_cmsplugin_page_id" ON "cms_cmsplugin" ("page_id"); []
	   = CREATE INDEX "cms_cmsplugin_placeholder" ON "cms_cmsplugin" ("placeholder"); []
	   = CREATE INDEX "cms_cmsplugin_placeholder_like" ON "cms_cmsplugin" ("placeholder" varchar_pattern_ops); []
	   = CREATE INDEX "cms_cmsplugin_plugin_type" ON "cms_cmsplugin" ("plugin_type"); []
	   = CREATE INDEX "cms_cmsplugin_plugin_type_like" ON "cms_cmsplugin" ("plugin_type" varchar_pattern_ops); []
	   = CREATE INDEX "cms_title_language" ON "cms_title" ("language"); []
	   = CREATE INDEX "cms_title_language_like" ON "cms_title" ("language" varchar_pattern_ops); []
	   = ALTER TABLE "cms_title" ADD CONSTRAINT "page_id_refs_id_772ba48efc98665f" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_title_page_id" ON "cms_title" ("page_id"); []
	   = CREATE INDEX "cms_title_path" ON "cms_title" ("path"); []
	   = CREATE INDEX "cms_title_path_like" ON "cms_title" ("path" varchar_pattern_ops); []
	   = CREATE INDEX "cms_title_slug" ON "cms_title" ("slug"); []
	   = CREATE INDEX "cms_title_slug_like" ON "cms_title" ("slug" varchar_pattern_ops); []
	   = ALTER TABLE "cms_pagepermission" ADD CONSTRAINT "group_id_refs_id_4b6b4203d3639033" FOREIGN KEY ("group_id") REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagepermission_group_id" ON "cms_pagepermission" ("group_id"); []
	   = ALTER TABLE "cms_pagepermission" ADD CONSTRAINT "page_id_refs_id_77f67714d31a36ca" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagepermission_page_id" ON "cms_pagepermission" ("page_id"); []
	   = ALTER TABLE "cms_pagepermission" ADD CONSTRAINT "user_id_refs_id_280a94e34f0ab76c" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagepermission_user_id" ON "cms_pagepermission" ("user_id"); []
	   = CREATE INDEX "cms_page_status" ON "cms_page" ("status"); []
	   = CREATE INDEX "cms_page_rght" ON "cms_page" ("rght"); []
	   = CREATE INDEX "cms_page_level" ON "cms_page" ("level"); []
	   = CREATE INDEX "cms_page_navigation_extenders" ON "cms_page" ("navigation_extenders"); []
	   = CREATE INDEX "cms_page_navigation_extenders_like" ON "cms_page" ("navigation_extenders" varchar_pattern_ops); []
	   = CREATE INDEX "cms_page_has_url_overwrite" ON "cms_page" ("has_url_overwrite"); []
	   = CREATE INDEX "cms_page_url_overwrite" ON "cms_page" ("url_overwrite"); []
	   = CREATE INDEX "cms_page_url_overwrite_like" ON "cms_page" ("url_overwrite" varchar_pattern_ops); []
	   = ALTER TABLE "cms_page" ADD CONSTRAINT "parent_id_refs_id_122ab180653a773" FOREIGN KEY ("parent_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_page_parent_id" ON "cms_page" ("parent_id"); []
	   = ALTER TABLE "cms_page" ADD CONSTRAINT "author_id_refs_id_30ed19c7430a69ef" FOREIGN KEY ("author_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_page_author_id" ON "cms_page" ("author_id"); []
	   = CREATE INDEX "cms_page_reverse_id" ON "cms_page" ("reverse_id"); []
	   = CREATE INDEX "cms_page_reverse_id_like" ON "cms_page" ("reverse_id" varchar_pattern_ops); []
	   = CREATE INDEX "cms_page_soft_root" ON "cms_page" ("soft_root"); []
	   = CREATE INDEX "cms_page_lft" ON "cms_page" ("lft"); []
	   = CREATE INDEX "cms_page_publication_end_date" ON "cms_page" ("publication_end_date"); []
	   = CREATE INDEX "cms_page_tree_id" ON "cms_page" ("tree_id"); []
	   = CREATE INDEX "cms_page_publication_date" ON "cms_page" ("publication_date"); []
	   = CREATE INDEX "cms_page_in_navigation" ON "cms_page" ("in_navigation"); []
	   = CREATE INDEX "cms_placeholder_language" ON "cms_placeholder" ("language"); []
	   = CREATE INDEX "cms_placeholder_language_like" ON "cms_placeholder" ("language" varchar_pattern_ops); []
	   = CREATE INDEX "cms_placeholder_name" ON "cms_placeholder" ("name"); []
	   = CREATE INDEX "cms_placeholder_name_like" ON "cms_placeholder" ("name" varchar_pattern_ops); []
	   = ALTER TABLE "cms_placeholder" ADD CONSTRAINT "page_id_refs_id_5527b13f4450cc54" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_placeholder_page_id" ON "cms_placeholder" ("page_id"); []
	   = ALTER TABLE "cms_page_sites" ADD CONSTRAINT "page_id_refs_id_382605665febd886" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_page_sites_page_id" ON "cms_page_sites" ("page_id"); []
	   = ALTER TABLE "cms_page_sites" ADD CONSTRAINT "site_id_refs_id_57aa8d80b2133507" FOREIGN KEY ("site_id") REFERENCES "django_site" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_page_sites_site_id" ON "cms_page_sites" ("site_id"); []
	 > cms:0002_auto_start
	 > cms:0003_remove_placeholder
	   = DROP TABLE "cms_placeholder" CASCADE; []
	 > cms:0004_textobjects
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'CHECK']
	   = ALTER TABLE "cms_cmsplugin" DROP CONSTRAINT "cms_cmsplugin_position_check" []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'FOREIGN KEY']
	   = ALTER TABLE "cms_cmsplugin" ALTER COLUMN "position" TYPE smallint, ALTER COLUMN "position" DROP NOT NULL, ALTER COLUMN "position" DROP DEFAULT; []
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "parent_id" integer NULL; []
	   = ALTER TABLE "cms_cmsplugin" ADD CONSTRAINT "parent_id_refs_id_4f240e19e0b32a03" FOREIGN KEY ("parent_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_cmsplugin_parent_id" ON "cms_cmsplugin" ("parent_id"); []
	 > cms:0005_mptt_added_to_plugins
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "tree_id" integer CHECK ("tree_id" >= 0) NOT NULL DEFAULT 0; []
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "lft" integer CHECK ("lft" >= 0) NOT NULL DEFAULT 0; []
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "rght" integer CHECK ("rght" >= 0) NOT NULL DEFAULT 0; []
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "level" integer CHECK ("level" >= 0) NOT NULL DEFAULT 0; []
	   = CREATE INDEX "cms_cmsplugin_tree_id" ON "cms_cmsplugin" ("tree_id"); []
	   = CREATE INDEX "cms_cmsplugin_lft" ON "cms_cmsplugin" ("lft"); []
	   = CREATE INDEX "cms_cmsplugin_rght" ON "cms_cmsplugin" ("rght"); []
	   = CREATE INDEX "cms_cmsplugin_level" ON "cms_cmsplugin" ("level"); []
	 > text:0001_initial
	   = CREATE TABLE "text_text" ("body" text NOT NULL, "cmsplugin_ptr_id" integer NOT NULL UNIQUE); []
	   = ALTER TABLE "text_text" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_344c4334bf9780bc" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > text:0002_freeze
	 > cms:0006_apphook
	   = ALTER TABLE "cms_title" ADD COLUMN "has_url_overwrite" boolean NOT NULL DEFAULT False; []
	   = ALTER TABLE "cms_title" ADD COLUMN "application_urls" varchar(32) NULL; []
	   = ALTER TABLE "cms_page" DROP COLUMN "has_url_overwrite" CASCADE; []
	   = ALTER TABLE "cms_page" DROP COLUMN "url_overwrite" CASCADE; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'FOREIGN KEY']
	   = ALTER TABLE "cms_page" ALTER COLUMN "status" TYPE integer, ALTER COLUMN "status" SET NOT NULL, ALTER COLUMN "status" SET DEFAULT %s ; [0]
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'FOREIGN KEY']
	   = ALTER TABLE "cms_page" ALTER COLUMN "reverse_id" TYPE varchar(40), ALTER COLUMN "reverse_id" DROP NOT NULL, ALTER COLUMN "reverse_id" DROP DEFAULT; []
	   = CREATE INDEX "cms_title_has_url_overwrite" ON "cms_title" ("has_url_overwrite"); []
	   = CREATE INDEX "cms_title_application_urls" ON "cms_title" ("application_urls"); []
	   = CREATE INDEX "cms_title_application_urls_like" ON "cms_title" ("application_urls" varchar_pattern_ops); []
	 > cms:0007_apphook_longer
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'FOREIGN KEY']
	   = ALTER TABLE "cms_title" ALTER COLUMN "application_urls" TYPE varchar(200), ALTER COLUMN "application_urls" DROP NOT NULL, ALTER COLUMN "application_urls" DROP DEFAULT; []
	 > cms:0008_redirects
	   = ALTER TABLE "cms_title" ADD COLUMN "redirect" varchar(255) NULL; []
	 > cms:0009_added_meta_fields
	   = ALTER TABLE "cms_title" ADD COLUMN "meta_keywords" varchar(255) NULL; []
	   = ALTER TABLE "cms_title" ADD COLUMN "meta_description" text NULL; []
	 > cms:0010_5char_language
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'FOREIGN KEY']
	   = ALTER TABLE "cms_title" ALTER COLUMN "language" TYPE varchar(5), ALTER COLUMN "language" SET NOT NULL, ALTER COLUMN "language" DROP DEFAULT; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'FOREIGN KEY']
	   = ALTER TABLE "cms_cmsplugin" ALTER COLUMN "language" TYPE varchar(5), ALTER COLUMN "language" SET NOT NULL, ALTER COLUMN "language" DROP DEFAULT; []
	 > cms:0011_title_overwrites
	   = ALTER TABLE "cms_title" ADD COLUMN "page_title" varchar(255) NULL; []
	   = ALTER TABLE "cms_title" ADD COLUMN "menu_title" varchar(255) NULL; []
	 > cms:0012_publisher
	   = CREATE TABLE "cms_publiccmsplugin" ("rght" integer CHECK ("rght" >= 0) NOT NULL, "parent_id" integer NULL, "language" varchar(5) NOT NULL, "level" integer CHECK ("level" >= 0) NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "page_id" integer NOT NULL, "lft" integer CHECK ("lft" >= 0) NOT NULL, "tree_id" integer CHECK ("tree_id" >= 0) NOT NULL, "position" smallint CHECK ("position" >= 0) NULL, "creation_date" timestamp with time zone NOT NULL DEFAULT '2009-06-29 09:02:15.178714', "placeholder" varchar(50) NOT NULL, "id" serial NOT NULL PRIMARY KEY, "plugin_type" varchar(50) NOT NULL); []
	   = CREATE TABLE "cms_pageuser" ("user_ptr_id" integer NOT NULL PRIMARY KEY, "created_by_id" integer NOT NULL); []
	   = CREATE TABLE "cms_publictitle" ("menu_title" varchar(255) NULL, "redirect" varchar(255) NULL, "meta_keywords" varchar(255) NULL, "page_title" varchar(255) NULL, "language" varchar(5) NOT NULL, "title" varchar(255) NOT NULL, "has_url_overwrite" boolean NOT NULL DEFAULT False, "application_urls" varchar(200) NULL, "creation_date" timestamp with time zone NOT NULL DEFAULT '2009-06-29 09:02:15.525211', "id" serial NOT NULL PRIMARY KEY, "path" varchar(255) NOT NULL, "meta_description" text NULL, "slug" varchar(255) NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "page_id" integer NOT NULL); []
	   = CREATE TABLE "cms_globalpagepermission" ("can_publish" boolean NOT NULL DEFAULT True, "group_id" integer NULL, "can_moderate" boolean NOT NULL DEFAULT True, "can_change" boolean NOT NULL DEFAULT True, "can_change_permissions" boolean NOT NULL DEFAULT False, "can_recover_page" boolean NOT NULL DEFAULT True, "can_add" boolean NOT NULL DEFAULT True, "user_id" integer NULL, "can_delete" boolean NOT NULL DEFAULT True, "can_move_page" boolean NOT NULL DEFAULT True, "id" serial NOT NULL PRIMARY KEY, "can_change_softroot" boolean NOT NULL DEFAULT False); []
	   = CREATE TABLE "cms_publicpage" ("rght" integer CHECK ("rght" >= 0) NOT NULL, "level" integer CHECK ("level" >= 0) NOT NULL, "navigation_extenders" varchar(80) NULL, "parent_id" integer NULL, "author_id" integer NOT NULL, "reverse_id" varchar(40) NULL, "login_required" boolean NOT NULL DEFAULT False, "mark_delete" boolean NOT NULL DEFAULT False, "site_id" integer NOT NULL, "soft_root" boolean NOT NULL DEFAULT False, "creation_date" timestamp with time zone NOT NULL DEFAULT '2009-06-29 09:02:16.369082', "lft" integer CHECK ("lft" >= 0) NOT NULL, "publication_end_date" timestamp with time zone NULL, "moderator_state" smallint NOT NULL DEFAULT 1, "template" varchar(100) NOT NULL, "published" boolean NOT NULL DEFAULT False, "tree_id" integer CHECK ("tree_id" >= 0) NOT NULL, "publication_date" timestamp with time zone NULL, "in_navigation" boolean NOT NULL DEFAULT True, "id" serial NOT NULL PRIMARY KEY); []
	   = CREATE TABLE "cms_pagemoderator" ("moderate_page" boolean NOT NULL DEFAULT False, "moderate_children" boolean NOT NULL DEFAULT False, "page_id" integer NOT NULL, "user_id" integer NOT NULL, "id" serial NOT NULL PRIMARY KEY, "moderate_descendants" boolean NOT NULL DEFAULT False); []
	   = CREATE TABLE "cms_pagemoderatorstate" ("created" timestamp with time zone NOT NULL, "page_id" integer NOT NULL, "user_id" integer NULL, "action" varchar(3) NULL, "message" text NOT NULL DEFAULT '', "id" serial NOT NULL PRIMARY KEY); []
	   = CREATE TABLE "cms_pageusergroup" ("group_ptr_id" integer NOT NULL PRIMARY KEY, "created_by_id" integer NOT NULL); []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_delete" boolean NOT NULL DEFAULT True; []
	   = ALTER TABLE "cms_page" ADD COLUMN "moderator_state" smallint NOT NULL DEFAULT 1; []
	   = ALTER TABLE "cms_page" ADD COLUMN "published" boolean NOT NULL DEFAULT False; []
	   = ALTER TABLE "cms_page" ADD COLUMN "site_id" integer NOT NULL DEFAULT 1; []
	   = ALTER TABLE "cms_cmsplugin" ADD COLUMN "inherited_public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_change_permissions" boolean NOT NULL DEFAULT False; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_moderate" boolean NOT NULL DEFAULT True; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_add" boolean NOT NULL DEFAULT True; []
	   = ALTER TABLE "cms_page" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "grant_on" integer NOT NULL DEFAULT 5; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_move_page" boolean NOT NULL DEFAULT True; []
	   = ALTER TABLE "cms_title" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "cms_pagepermission" ADD COLUMN "can_change" boolean NOT NULL DEFAULT True; []
	   = ALTER TABLE "cms_pagepermission" DROP COLUMN "everybody" CASCADE; []
	   = ALTER TABLE "cms_pagepermission" DROP COLUMN "type" CASCADE; []
	   = ALTER TABLE "cms_page" DROP COLUMN "status" CASCADE; []
	   = ALTER TABLE "cms_pagepermission" DROP COLUMN "can_edit" CASCADE; []
	   = ALTER TABLE "cms_publictitle" ADD CONSTRAINT "cms_publictitle_language_9f6427dde8710c6_uniq" UNIQUE ("language", "page_id") []
	   = CREATE INDEX "cms_publiccmsplugin_rght" ON "cms_publiccmsplugin" ("rght"); []
	   = ALTER TABLE "cms_publiccmsplugin" ADD CONSTRAINT "parent_id_refs_id_63b4d88ea318ac67" FOREIGN KEY ("parent_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publiccmsplugin_parent_id" ON "cms_publiccmsplugin" ("parent_id"); []
	   = CREATE INDEX "cms_publiccmsplugin_language" ON "cms_publiccmsplugin" ("language"); []
	   = CREATE INDEX "cms_publiccmsplugin_language_like" ON "cms_publiccmsplugin" ("language" varchar_pattern_ops); []
	   = CREATE INDEX "cms_publiccmsplugin_level" ON "cms_publiccmsplugin" ("level"); []
	   = ALTER TABLE "cms_publiccmsplugin" ADD CONSTRAINT "page_id_refs_id_43d4908c0735fbaf" FOREIGN KEY ("page_id") REFERENCES "cms_publicpage" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publiccmsplugin_page_id" ON "cms_publiccmsplugin" ("page_id"); []
	   = CREATE INDEX "cms_publiccmsplugin_lft" ON "cms_publiccmsplugin" ("lft"); []
	   = CREATE INDEX "cms_publiccmsplugin_tree_id" ON "cms_publiccmsplugin" ("tree_id"); []
	   = CREATE INDEX "cms_publiccmsplugin_placeholder" ON "cms_publiccmsplugin" ("placeholder"); []
	   = CREATE INDEX "cms_publiccmsplugin_placeholder_like" ON "cms_publiccmsplugin" ("placeholder" varchar_pattern_ops); []
	   = CREATE INDEX "cms_publiccmsplugin_plugin_type" ON "cms_publiccmsplugin" ("plugin_type"); []
	   = CREATE INDEX "cms_publiccmsplugin_plugin_type_like" ON "cms_publiccmsplugin" ("plugin_type" varchar_pattern_ops); []
	   = ALTER TABLE "cms_pageuser" ADD CONSTRAINT "user_ptr_id_refs_id_23321fd516b8b1ea" FOREIGN KEY ("user_ptr_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cms_pageuser" ADD CONSTRAINT "created_by_id_refs_id_23321fd516b8b1ea" FOREIGN KEY ("created_by_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pageuser_created_by_id" ON "cms_pageuser" ("created_by_id"); []
	   = CREATE INDEX "cms_publictitle_language" ON "cms_publictitle" ("language"); []
	   = CREATE INDEX "cms_publictitle_language_like" ON "cms_publictitle" ("language" varchar_pattern_ops); []
	   = CREATE INDEX "cms_publictitle_has_url_overwrite" ON "cms_publictitle" ("has_url_overwrite"); []
	   = CREATE INDEX "cms_publictitle_application_urls" ON "cms_publictitle" ("application_urls"); []
	   = CREATE INDEX "cms_publictitle_application_urls_like" ON "cms_publictitle" ("application_urls" varchar_pattern_ops); []
	   = CREATE INDEX "cms_publictitle_path" ON "cms_publictitle" ("path"); []
	   = CREATE INDEX "cms_publictitle_path_like" ON "cms_publictitle" ("path" varchar_pattern_ops); []
	   = CREATE INDEX "cms_publictitle_slug" ON "cms_publictitle" ("slug"); []
	   = CREATE INDEX "cms_publictitle_slug_like" ON "cms_publictitle" ("slug" varchar_pattern_ops); []
	   = ALTER TABLE "cms_publictitle" ADD CONSTRAINT "page_id_refs_id_75c25ee9226944c7" FOREIGN KEY ("page_id") REFERENCES "cms_publicpage" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publictitle_page_id" ON "cms_publictitle" ("page_id"); []
	   = ALTER TABLE "cms_globalpagepermission" ADD CONSTRAINT "group_id_refs_id_4f6f13d5b12278f8" FOREIGN KEY ("group_id") REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_globalpagepermission_group_id" ON "cms_globalpagepermission" ("group_id"); []
	   = ALTER TABLE "cms_globalpagepermission" ADD CONSTRAINT "user_id_refs_id_447e6e76f5365069" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_globalpagepermission_user_id" ON "cms_globalpagepermission" ("user_id"); []
	   = CREATE INDEX "cms_publicpage_rght" ON "cms_publicpage" ("rght"); []
	   = CREATE INDEX "cms_publicpage_level" ON "cms_publicpage" ("level"); []
	   = CREATE INDEX "cms_publicpage_navigation_extenders" ON "cms_publicpage" ("navigation_extenders"); []
	   = CREATE INDEX "cms_publicpage_navigation_extenders_like" ON "cms_publicpage" ("navigation_extenders" varchar_pattern_ops); []
	   = ALTER TABLE "cms_publicpage" ADD CONSTRAINT "parent_id_refs_id_342c04c3d4458e77" FOREIGN KEY ("parent_id") REFERENCES "cms_publicpage" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publicpage_parent_id" ON "cms_publicpage" ("parent_id"); []
	   = ALTER TABLE "cms_publicpage" ADD CONSTRAINT "author_id_refs_id_2206d0fb466c4cba" FOREIGN KEY ("author_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publicpage_author_id" ON "cms_publicpage" ("author_id"); []
	   = CREATE INDEX "cms_publicpage_reverse_id" ON "cms_publicpage" ("reverse_id"); []
	   = CREATE INDEX "cms_publicpage_reverse_id_like" ON "cms_publicpage" ("reverse_id" varchar_pattern_ops); []
	   = ALTER TABLE "cms_publicpage" ADD CONSTRAINT "site_id_refs_id_74f4f96c9d9f0f3d" FOREIGN KEY ("site_id") REFERENCES "django_site" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_publicpage_site_id" ON "cms_publicpage" ("site_id"); []
	   = CREATE INDEX "cms_publicpage_soft_root" ON "cms_publicpage" ("soft_root"); []
	   = CREATE INDEX "cms_publicpage_lft" ON "cms_publicpage" ("lft"); []
	   = CREATE INDEX "cms_publicpage_publication_end_date" ON "cms_publicpage" ("publication_end_date"); []
	   = CREATE INDEX "cms_publicpage_tree_id" ON "cms_publicpage" ("tree_id"); []
	   = CREATE INDEX "cms_publicpage_publication_date" ON "cms_publicpage" ("publication_date"); []
	   = CREATE INDEX "cms_publicpage_in_navigation" ON "cms_publicpage" ("in_navigation"); []
	   = ALTER TABLE "cms_pagemoderator" ADD CONSTRAINT "page_id_refs_id_5d795dd492bc8605" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagemoderator_page_id" ON "cms_pagemoderator" ("page_id"); []
	   = ALTER TABLE "cms_pagemoderator" ADD CONSTRAINT "user_id_refs_id_4cbb99dfc574e281" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagemoderator_user_id" ON "cms_pagemoderator" ("user_id"); []
	   = ALTER TABLE "cms_pagemoderatorstate" ADD CONSTRAINT "page_id_refs_id_3cff375bf4dc9e9d" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagemoderatorstate_page_id" ON "cms_pagemoderatorstate" ("page_id"); []
	   = ALTER TABLE "cms_pagemoderatorstate" ADD CONSTRAINT "user_id_refs_id_210628e22808fb19" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pagemoderatorstate_user_id" ON "cms_pagemoderatorstate" ("user_id"); []
	   = ALTER TABLE "cms_pageusergroup" ADD CONSTRAINT "group_ptr_id_refs_id_49e243cc99e5e357" FOREIGN KEY ("group_ptr_id") REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cms_pageusergroup" ADD CONSTRAINT "created_by_id_refs_id_47ce3c433dc63396" FOREIGN KEY ("created_by_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_pageusergroup_created_by_id" ON "cms_pageusergroup" ("created_by_id"); []
	   = ALTER TABLE "cms_page" ADD CONSTRAINT "site_id_refs_id_104217d4ed70f71a" FOREIGN KEY ("site_id") REFERENCES "django_site" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_page_site_id" ON "cms_page" ("site_id"); []
	   = ALTER TABLE "cms_cmsplugin" ADD CONSTRAINT "inherited_public_id_refs_id_1064c8c1d3fe7278" FOREIGN KEY ("inherited_public_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cms_page" ADD CONSTRAINT "public_id_refs_id_7844850a7cf317ce" FOREIGN KEY ("public_id") REFERENCES "cms_publicpage" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cms_title" ADD CONSTRAINT "public_id_refs_id_5bc6cb8c03cbecb8" FOREIGN KEY ("public_id") REFERENCES "cms_publictitle" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > text:0003_publisher
	   = ALTER TABLE "text_text" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = CREATE TABLE "text_publictext" ("body" text NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "text_text" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_6b951fd908b7574" FOREIGN KEY ("public_id") REFERENCES "text_publictext" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "text_publictext" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_1e156954d1c94d78" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > snippet:0001_initial
	   = CREATE TABLE "snippet_snippet" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(255) NOT NULL UNIQUE, "html" text NOT NULL); []
	   = CREATE TABLE "snippet_snippetptr" ("cmsplugin_ptr_id" integer NOT NULL UNIQUE, "snippet_id" integer NOT NULL); []
	   = ALTER TABLE "snippet_snippetptr" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_63ded10962cab895" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "snippet_snippetptr" ADD CONSTRAINT "snippet_id_refs_id_8063d83ce9512ce" FOREIGN KEY ("snippet_id") REFERENCES "snippet_snippet" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "snippet_snippetptr_snippet_id" ON "snippet_snippetptr" ("snippet_id"); []
	 > snippet:0002_publisher
	   = CREATE TABLE "snippet_publicsnippetptr" ("snippet_id" integer NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "snippet_snippetptr" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "snippet_publicsnippetptr" ADD CONSTRAINT "snippet_id_refs_id_7b6983dbcf32eb21" FOREIGN KEY ("snippet_id") REFERENCES "snippet_snippet" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "snippet_publicsnippetptr_snippet_id" ON "snippet_publicsnippetptr" ("snippet_id"); []
	   = ALTER TABLE "snippet_publicsnippetptr" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_59f35764296a9a39" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "snippet_snippetptr" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_6b19d407746b4bc6" FOREIGN KEY ("public_id") REFERENCES "snippet_publicsnippetptr" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > picture:0001_initial
	   = CREATE TABLE "picture_picture" ("link" varchar(255) NULL, "image" varchar(100) NOT NULL, "cmsplugin_ptr_id" integer NOT NULL UNIQUE, "alt" varchar(255) NULL); []
	   = ALTER TABLE "picture_picture" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_624cc071dc33150a" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > picture:0002_link_rename
	   = ALTER TABLE "picture_picture" RENAME COLUMN "link" TO "url"; []
	 > picture:0003_freeze
	 > picture:0004_publisher
	   = CREATE TABLE "picture_publicpicture" ("url" varchar(255) NULL, "image" varchar(100) NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "alt" varchar(255) NULL, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "picture_picture" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "picture_publicpicture" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_4e1850f6fe0754b4" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "picture_picture" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_130a2983e3e745b6" FOREIGN KEY ("public_id") REFERENCES "picture_publicpicture" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > link:0001_initial
	   = CREATE TABLE "link_link" ("link" varchar(200) NULL, "cmsplugin_ptr_id" integer NOT NULL UNIQUE, "name" varchar(40) NOT NULL, "page_id" integer NULL); []
	   = ALTER TABLE "link_link" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_27a18a4d447cf852" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "link_link" ADD CONSTRAINT "page_id_refs_id_74739381d0206170" FOREIGN KEY ("page_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "link_link_page_id" ON "link_link" ("page_id"); []
	 > link:0002_link_rename
	   = ALTER TABLE "link_link" RENAME COLUMN "link" TO "url"; []
	 > link:0003_page_link
	   = ALTER TABLE "link_link" RENAME COLUMN "page_id" TO "page_link_id"; []
	 > link:0004_larger_link_names
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'link_link', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'link_link', 'FOREIGN KEY']
	   = ALTER TABLE "link_link" ALTER COLUMN "name" TYPE varchar(256), ALTER COLUMN "name" SET NOT NULL, ALTER COLUMN "name" DROP DEFAULT; []
	 > link:0005_publisher
	   = CREATE TABLE "link_publiclink" ("url" varchar(200) NULL, "page_link_id" integer NULL, "mark_delete" boolean NOT NULL DEFAULT False, "name" varchar(256) NOT NULL, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "link_link" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "link_publiclink" ADD CONSTRAINT "page_link_id_refs_id_5937d09666eb6072" FOREIGN KEY ("page_link_id") REFERENCES "cms_publicpage" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "link_publiclink_page_link_id" ON "link_publiclink" ("page_link_id"); []
	   = ALTER TABLE "link_publiclink" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_303d3e01c351698a" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "link_link" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_2bb87849ea9eee30" FOREIGN KEY ("public_id") REFERENCES "link_publiclink" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > googlemap:0001_initial
	   = CREATE TABLE "googlemap_publicgooglemap" ("city" varchar(100) NOT NULL, "title" varchar(100) NULL, "streetnr" integer NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "zoom" integer NULL, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY, "content" varchar(255) NULL, "street" varchar(100) NOT NULL, "postcode" integer NOT NULL); []
	   = CREATE TABLE "googlemap_googlemap" ("city" varchar(100) NOT NULL, "title" varchar(100) NULL, "streetnr" integer NOT NULL, "cmsplugin_ptr_id" integer NOT NULL PRIMARY KEY, "zoom" integer NULL, "content" varchar(255) NULL, "street" varchar(100) NOT NULL, "postcode" integer NOT NULL, "public_id" integer NULL UNIQUE); []
	   = ALTER TABLE "googlemap_publicgooglemap" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_1acaca20d5c32314" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "googlemap_googlemap" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_4ec9557a35fc351a" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "googlemap_googlemap" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_20a4e74e3b8139a" FOREIGN KEY ("public_id") REFERENCES "googlemap_publicgooglemap" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > flash:0001_initial
	   = CREATE TABLE "flash_flash" ("width" varchar(6) NOT NULL, "cmsplugin_ptr_id" integer NOT NULL UNIQUE, "file" varchar(100) NOT NULL, "height" varchar(6) NOT NULL); []
	   = ALTER TABLE "flash_flash" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_5cbc50a2ef3dc97e" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > flash:0002_freeze
	 > flash:0003_publisher
	   = CREATE TABLE "flash_publicflash" ("width" varchar(6) NOT NULL, "height" varchar(6) NOT NULL, "mark_delete" boolean NOT NULL DEFAULT False, "file" varchar(100) NOT NULL, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "flash_flash" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "flash_publicflash" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_2c5ce5711ad01fb8" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "flash_flash" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_4e064f87d18179f2" FOREIGN KEY ("public_id") REFERENCES "flash_publicflash" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > file:0001_initial
	   = CREATE TABLE "file_file" ("cmsplugin_ptr_id" integer NOT NULL UNIQUE, "file" varchar(100) NOT NULL, "title" varchar(255) NULL); []
	   = ALTER TABLE "file_file" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_429eee6130503b22" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > file:0002_freeze
	 > file:0003_publisher
	   = CREATE TABLE "file_publicfile" ("title" varchar(255) NULL, "mark_delete" boolean NOT NULL DEFAULT False, "file" varchar(100) NOT NULL, "publiccmsplugin_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = ALTER TABLE "file_file" ADD COLUMN "public_id" integer NULL UNIQUE; []
	   = ALTER TABLE "file_publicfile" ADD CONSTRAINT "publiccmsplugin_ptr_id_refs_id_3f0245d42bf6134e" FOREIGN KEY ("publiccmsplugin_ptr_id") REFERENCES "cms_publiccmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "file_file" ADD CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_77b9e3de98592d4c" FOREIGN KEY ("public_id") REFERENCES "file_publicfile" ("publiccmsplugin_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > cms:0013_site_copy
	 > cms:0014_sites_removed
	   = DROP TABLE "cms_page_sites" CASCADE; []
	 > cms:0015_modified_by_added
	   = ALTER TABLE "cms_publicpage" ADD COLUMN "changed_by" varchar(70) NOT NULL DEFAULT ''; []
	   = ALTER TABLE "cms_page" ADD COLUMN "changed_by" varchar(70) NOT NULL DEFAULT ''; []
	   = ALTER TABLE "cms_publicpage" ADD COLUMN "created_by" varchar(70) NOT NULL DEFAULT ''; []
	   = ALTER TABLE "cms_page" ADD COLUMN "created_by" varchar(70) NOT NULL DEFAULT ''; []
	 > cms:0016_author_copy
	 > cms:0017_author_removed
	   = ALTER TABLE "cms_publicpage" DROP COLUMN "author_id" CASCADE; []
	   = ALTER TABLE "cms_page" DROP COLUMN "author_id" CASCADE; []
	 > cms:0018_site_permissions
	   = CREATE TABLE "cms_globalpagepermission_sites" ("id" serial NOT NULL PRIMARY KEY, "globalpagepermission_id" integer NOT NULL, "site_id" integer NOT NULL); []
	   = ALTER TABLE "cms_globalpagepermission_sites" ADD CONSTRAINT "globalpagepermission_id_refs_id_2d0cf4fc2c730e06" FOREIGN KEY ("globalpagepermission_id") REFERENCES "cms_globalpagepermission" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_globalpagepermission_sites_globalpagepermission_id" ON "cms_globalpagepermission_sites" ("globalpagepermission_id"); []
	   = ALTER TABLE "cms_globalpagepermission_sites" ADD CONSTRAINT "site_id_refs_id_70c81e4a38dfe611" FOREIGN KEY ("site_id") REFERENCES "django_site" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cms_globalpagepermission_sites_site_id" ON "cms_globalpagepermission_sites" ("site_id"); []
	 > cms:0019_public_table_renames
	   = ALTER TABLE "cms_publicpage" RENAME TO "cms_pagepublic"; []
	   = ALTER TABLE "cms_publicpage_id_seq" RENAME TO "cms_pagepublic_id_seq"; []
	   = ALTER TABLE "cms_publicpage_pkey" RENAME TO "cms_pagepublic_pkey"; []
	   = ALTER TABLE "cms_publictitle" RENAME TO "cms_titlepublic"; []
	   = ALTER TABLE "cms_publictitle_id_seq" RENAME TO "cms_titlepublic_id_seq"; []
	   = ALTER TABLE "cms_publictitle_pkey" RENAME TO "cms_titlepublic_pkey"; []
	   = ALTER TABLE "cms_publiccmsplugin" RENAME TO "cms_cmspluginpublic"; []
	   = ALTER TABLE "cms_publiccmsplugin_id_seq" RENAME TO "cms_cmspluginpublic_id_seq"; []
	   = ALTER TABLE "cms_publiccmsplugin_pkey" RENAME TO "cms_cmspluginpublic_pkey"; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_cmsplugin', 'FOREIGN KEY']
	   = ALTER TABLE "cms_cmsplugin" DROP CONSTRAINT "inherited_public_id_refs_id_1064c8c1d3fe7278" []
	   = ALTER TABLE "cms_cmsplugin" ALTER COLUMN "inherited_public_id" TYPE integer, ALTER COLUMN "inherited_public_id" DROP NOT NULL, ALTER COLUMN "inherited_public_id" DROP DEFAULT; []
	   = ALTER TABLE "cms_cmsplugin" ADD CONSTRAINT "inherited_public_id_refs_id_6338976928e448ee" FOREIGN KEY ("inherited_public_id") REFERENCES "cms_cmspluginpublic" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_title', 'FOREIGN KEY']
	   = ALTER TABLE "cms_title" DROP CONSTRAINT "public_id_refs_id_5bc6cb8c03cbecb8" []
	   = ALTER TABLE "cms_title" ALTER COLUMN "public_id" TYPE integer, ALTER COLUMN "public_id" DROP NOT NULL, ALTER COLUMN "public_id" DROP DEFAULT; []
	   = ALTER TABLE "cms_title" ADD CONSTRAINT "public_id_refs_id_55ec0bdba0ffd9da" FOREIGN KEY ("public_id") REFERENCES "cms_titlepublic" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cms_page', 'FOREIGN KEY']
	   = ALTER TABLE "cms_page" DROP CONSTRAINT "public_id_refs_id_7844850a7cf317ce" []
	   = ALTER TABLE "cms_page" ALTER COLUMN "public_id" TYPE integer, ALTER COLUMN "public_id" DROP NOT NULL, ALTER COLUMN "public_id" DROP DEFAULT; []
	   = ALTER TABLE "cms_page" ADD CONSTRAINT "public_id_refs_id_3064c28c9d7843ba" FOREIGN KEY ("public_id") REFERENCES "cms_pagepublic" ("id") DEFERRABLE INITIALLY DEFERRED; []
	 > teaser:0001_initial
	   = CREATE TABLE "cmsplugin_teaserpublic" ("description" text NULL, "title" varchar(255) NOT NULL, "url" varchar(255) NULL, "image" varchar(100) NULL, "mark_delete" boolean NOT NULL DEFAULT False, "page_link_id" integer NULL, "cmspluginpublic_ptr_id" integer NOT NULL PRIMARY KEY); []
	   = CREATE TABLE "cmsplugin_teaser" ("description" text NULL, "title" varchar(255) NOT NULL, "url" varchar(255) NULL, "image" varchar(100) NULL, "cmsplugin_ptr_id" integer NOT NULL PRIMARY KEY, "page_link_id" integer NULL, "public_id" integer NULL UNIQUE); []
	   = ALTER TABLE "cmsplugin_teaserpublic" ADD CONSTRAINT "page_link_id_refs_id_c9d1f437fad8c53" FOREIGN KEY ("page_link_id") REFERENCES "cms_pagepublic" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cmsplugin_teaserpublic_page_link_id" ON "cmsplugin_teaserpublic" ("page_link_id"); []
	   = ALTER TABLE "cmsplugin_teaserpublic" ADD CONSTRAINT "cmspluginpublic_ptr_id_refs_id_2e0e8f6d982969cd" FOREIGN KEY ("cmspluginpublic_ptr_id") REFERENCES "cms_cmspluginpublic" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cmsplugin_teaser" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_1253ee2fd6a15acd" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = ALTER TABLE "cmsplugin_teaser" ADD CONSTRAINT "page_link_id_refs_id_7c39f228b9e9ae89" FOREIGN KEY ("page_link_id") REFERENCES "cms_page" ("id") DEFERRABLE INITIALLY DEFERRED; []
	   = CREATE INDEX "cmsplugin_teaser_page_link_id" ON "cmsplugin_teaser" ("page_link_id"); []
	   = ALTER TABLE "cmsplugin_teaser" ADD CONSTRAINT "public_id_refs_cmspluginpublic_ptr_id_3458df43d11c870a" FOREIGN KEY ("public_id") REFERENCES "cmsplugin_teaserpublic" ("cmspluginpublic_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	 > picture:0005_table_rename
	   = ALTER TABLE "picture_picture" RENAME TO "cmsplugin_picture"; []
	   = ALTER TABLE "picture_picture_id_seq" RENAME TO "cmsplugin_picture_id_seq"; []
	   ~ No such sequence (ignoring error)
	   = ALTER TABLE "picture_picture_pkey" RENAME TO "cmsplugin_picture_pkey"; []
	   ~ No such primary key (ignoring error)
	   = ALTER TABLE "picture_publicpicture" RENAME TO "cmsplugin_picturepublic"; []
	   = ALTER TABLE "picture_publicpicture_id_seq" RENAME TO "cmsplugin_picturepublic_id_seq"; []
	   ~ No such sequence (ignoring error)
	   = ALTER TABLE "picture_publicpicture_pkey" RENAME TO "cmsplugin_picturepublic_pkey"; []
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.constraint_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cmsplugin_picture', 'CHECK']
	   = 
	            SELECT kc.constraint_name, kc.column_name
	            FROM information_schema.key_column_usage AS kc
	            JOIN information_schema.table_constraints AS c ON
	                kc.table_schema = c.table_schema AND
	                kc.table_name = c.table_name AND
	                kc.constraint_name = c.constraint_name
	            WHERE
	                kc.table_schema = %s AND
	                kc.table_name = %s AND
	                c.constraint_type = %s
	         ['public', 'cmsplugin_picture', 'FOREIGN KEY']
	   = ALTER TABLE "cmsplugin_picture" DROP CONSTRAINT "public_id_refs_publiccmsplugin_ptr_id_130a2983e3e745b6" []
	   = ALTER TABLE "cmsplugin_picture" ALTER COLUMN "public_id" TYPE integer, ALTER COLUMN "public_id" DROP NOT NULL, ALTER COLUMN "public_id" DROP DEFAULT; []
	   = ALTER TABLE "cmsplugin_picture" ADD CONSTRAINT "public_id_refs_cmspluginpublic_ptr_id_669f42fb65efb9fc" FOREIGN KEY ("public_id") REFERENCES "cmsplugin_picturepublic" ("cmspluginpublic_ptr_id") DEFERRABLE INITIALLY DEFERRED; []
	Traceback (most recent call last):
	  File "manage.py", line 13, in <module>
	    execute_manager(settings)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
	    utility.execute()
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
	    self.fetch_command(subcommand).run_from_argv(self.argv)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
	    self.execute(*args, **options.__dict__)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/core/management/base.py", line 218, in execute
	    output = self.handle(*args, **options)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/management/commands/migrate.py", line 109, in handle
	    ignore_ghosts = ignore_ghosts,
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/__init__.py", line 202, in migrate_app
	    success = migrator.migrate_many(target, workplan, database)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 220, in migrate_many
	    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 291, in migrate_many
	    result = self.migrate(migration, database)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 125, in migrate
	    result = self.run(migration)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 99, in run
	    return self.run_migration(migration)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 81, in run_migration
	    migration_function()
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/migration/migrators.py", line 57, in <lambda>
	    return (lambda: direction(orm))
	  File "/Users/trent/dev/sites/greendriver.com/src/django-cms/cms/plugins/picture/migrations/0005_table_rename.py", line 12, in forwards
	    db.alter_column('cmsplugin_picture', 'public_id', orm['picture.picture:public'])
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/db/generic.py", line 373, in alter_column
	    field.rel.to._meta.get_field(field.rel.field_name).column
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/south/db/generic.py", line 134, in execute
	    cursor.execute(sql, params)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/db/backends/util.py", line 15, in execute
	    return self.cursor.execute(sql, params)
	  File "/Users/trent/dev/sites/greendriver.com/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
	    return self.cursor.execute(query, args)
	django.db.utils.DatabaseError: column "cmspluginpublic_ptr_id" referenced in foreign key constraint does not exist

comment:7 Changed 4 years ago by andrew

Are you sure that's not just a missed dependency? Could you post the output of "./manage.py migrate --list" as it was just after this failure?

comment:8 Changed 4 years ago by tjurewicz@…

Thanks for following up on this. I have now tested this migration on a few different servers running PostgreSQL 8.4 and confirmed the error. Here is the output of --list:

 cms
  (*) 0001_initial
  (*) 0002_auto_start
  (*) 0003_remove_placeholder
  (*) 0004_textobjects
  (*) 0005_mptt_added_to_plugins
  (*) 0006_apphook
  (*) 0007_apphook_longer
  (*) 0008_redirects
  (*) 0009_added_meta_fields
  (*) 0010_5char_language
  (*) 0011_title_overwrites
  (*) 0012_publisher
  (*) 0013_site_copy
  (*) 0014_sites_removed
  (*) 0015_modified_by_added
  (*) 0016_author_copy
  (*) 0017_author_removed
  (*) 0018_site_permissions
  (*) 0019_public_table_renames
  ( ) 0020_advanced_permissions
  ( ) 0021_publisher2
  ( ) 0022_login_required_added
  ( ) 0023_plugin_table_naming_function_changed
  ( ) 0024_added_placeholder_model
  ( ) 0025_placeholder_migration
  ( ) 0026_finish_placeholder_migration
  ( ) 0027_added_width_to_placeholder
  ( ) 0028_limit_visibility_in_menu_step1of3
  ( ) 0029_limit_visibility_in_menu_step2of3_data
  ( ) 0030_limit_visibility_in_menu_step3of3

 text
  (*) 0001_initial
  (*) 0002_freeze
  (*) 0003_publisher
  ( ) 0004_table_rename
  ( ) 0005_publisher2

 picture
  (*) 0001_initial
  (*) 0002_link_rename
  (*) 0003_freeze
  (*) 0004_publisher
  ( ) 0005_table_rename
  ( ) 0006_float_added
  ( ) 0007_publisher2
  ( ) 0008_longdesc_added

 file
  (*) 0001_initial
  (*) 0002_freeze
  (*) 0003_publisher
  ( ) 0004_table_rename
  ( ) 0005_publisher2

 flash
  (*) 0001_initial
  (*) 0002_freeze
  (*) 0003_publisher
  ( ) 0004_table_rename
  ( ) 0005_publisher2

 link
  (*) 0001_initial
  (*) 0002_link_rename
  (*) 0003_page_link
  (*) 0004_larger_link_names
  (*) 0005_publisher
  ( ) 0006_table_rename
  ( ) 0007_publisher2
  ( ) 0008_mailto

 snippet
  (*) 0001_initial
  (*) 0002_publisher
  ( ) 0003_table_rename
  ( ) 0004_publisher2
  ( ) 0005_template_added

 googlemap
  (*) 0001_initial
  ( ) 0002_table_rename
  ( ) 0006_publisher2
  ( ) 0007_latlng
  ( ) 0008_routeplaner
  ( ) 0009_routeplaner_title

 teaser
  (*) 0001_initial
  ( ) 0002_publisher2

 video
  ( ) 0001_initial
  ( ) 0002_color_mute_controller
  ( ) 0003_newplayer_step1
  ( ) 0004_newplayer_step2
  ( ) 0005_newplayer_step3
  ( ) 0006_newplayer_step4
  ( ) 0007_newplayer_step5

 twitter
  ( ) 0001_initial
  ( ) 0002_auto__add_twittersearch

 inherit
  ( ) 0001_initial
  ( ) 0002_fieldchanges

comment:9 Changed 4 years ago by steve@…

I've just hit this issue, too, on 8.4 with Django 1.2.0 (not 1.2.1, but I doubt that'll be related to things). It appears that hacking the migrations themselves may fix it (http://groups.google.com/group/django-cms/browse_thread/thread/d27ed4398eb473ea?pli=1), but am wondering if there's a south-related fix.

Here's my --list output, too, following a drop and recreate of the DB, a syncdb and the stalled migrations:

 cms
  (*) 0001_initial
  (*) 0002_auto_start
  (*) 0003_remove_placeholder
  (*) 0004_textobjects
  (*) 0005_mptt_added_to_plugins
  (*) 0006_apphook
  (*) 0007_apphook_longer
  (*) 0008_redirects
  (*) 0009_added_meta_fields
  (*) 0010_5char_language
  (*) 0011_title_overwrites
  (*) 0012_publisher
  ( ) 0013_site_copy
  ( ) 0014_sites_removed
  ( ) 0015_modified_by_added
  ( ) 0016_author_copy
  ( ) 0017_author_removed
  ( ) 0018_site_permissions
  ( ) 0019_public_table_renames
  ( ) 0020_advanced_permissions
  ( ) 0021_publisher2
  ( ) 0022_login_required_added
  ( ) 0023_plugin_table_naming_function_changed
  ( ) 0024_added_placeholder_model
  ( ) 0025_placeholder_migration
  ( ) 0026_finish_placeholder_migration
  ( ) 0027_added_width_to_placeholder

 text
  ( ) 0001_initial
  ( ) 0002_freeze
  ( ) 0003_publisher
  ( ) 0004_table_rename
  ( ) 0005_publisher2

 picture
  (*) 0001_initial
  (*) 0002_link_rename
  (*) 0003_freeze
  (*) 0004_publisher
  ( ) 0005_table_rename
  ( ) 0006_float_added
  ( ) 0007_publisher2
  ( ) 0008_longdesc_added

 link
  ( ) 0001_initial
  ( ) 0002_link_rename
  ( ) 0003_page_link
  ( ) 0004_larger_link_names
  ( ) 0005_publisher
  ( ) 0006_table_rename
  ( ) 0007_publisher2
  ( ) 0008_mailto

 file
  ( ) 0001_initial
  ( ) 0002_freeze
  ( ) 0003_publisher
  ( ) 0004_table_rename
  ( ) 0005_publisher2

 snippet
  ( ) 0001_initial
  ( ) 0002_publisher
  ( ) 0003_table_rename
  ( ) 0004_publisher2
  ( ) 0005_template_added

 googlemap
  ( ) 0001_initial
  ( ) 0002_table_rename
  ( ) 0006_publisher2
  ( ) 0007_latlng
  ( ) 0008_routeplaner
  ( ) 0009_routeplaner_title

comment:10 Changed 4 years ago by Jafula

I also came had this problem with trying to make a fresh install of django-cms 2.1.0 beta 3 with postgresql 8.4, python 2.6, django 1.2 and google brought me here.

My solution was to remove south from installed apps, drop the db, create the db, run syncdb, add south back to installed apps, run syncdb, then run migrate --fake

Hope that helps someone.

comment:11 Changed 4 years ago by andrew

It looks like the picture.0005_table_rename migration in django-cms needs fixing - specifically, this:

        db.alter_column('cmsplugin_picture', 'public_id', orm['picture.picture:public'])
        try:
            db.delete_foreign_key('cmsplugin_picture' ,'public_id')
        except:
            pass
        db.drop_primary_key("cmsplugin_picturepublic")
        db.rename_column("cmsplugin_picturepublic", "publiccmsplugin_ptr_id", "cmspluginpublic_ptr_id")

needs to actually be written like this:

        db.rename_column("cmsplugin_picturepublic", "publiccmsplugin_ptr_id", "cmspluginpublic_ptr_id")
        db.alter_column('cmsplugin_picture', 'public_id', orm['picture.picture:public'])
        try:
            db.delete_foreign_key('cmsplugin_picture' ,'public_id')
        except:
            pass
        db.drop_primary_key("cmsplugin_picturepublic")

I'm not entirely sure about that, but the basis of the problem is that the migration in question alters a column to point to a column that doesn't exist yet. Since this isn't a South bug per se, I'll have to leave this closed.

comment:12 Changed 4 years ago by anonymous

I'm having this identical problem trying to do an initial migration of an app, instead of syncdb (just like south documentation says to do)

My solution is the same as above - remove south from installed apps, and just do a manage.py syncdb, then reenable south...

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.