@@ -0,0 +1,1576 @@
+# Copyright (C) 2016 Google Inc., authors, and contributors %3Csee AUTHORS file%3E%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A# Created By: anze@reciprocitylabs.com%0A# Maintained By: anze@reciprocitylabs.com%0A%0A%22%22%22Migrate Assessment to Assignable mixin%0A%0ARevision ID: 6bed0575a0b%0ARevises: 262bbe790f4c%0ACreate Date: 2016-02-03 14:39:12.737518%0A%0A%22%22%22%0A%0A# Disable Invalid constant name pylint warning for mandatory Alembic variables.%0A# pylint: disable=C0103%0A%0Afrom alembic import op%0A%0A# revision identifiers, used by Alembic.%0Arevision = '6bed0575a0b'%0Adown_revision = '262bbe790f4c'%0A%0A%0Adef upgrade():%0A  op.execute(%22%22%22%0A      INSERT INTO relationships (%0A        modified_by_id, created_at, updated_at,%0A        source_id, source_type, destination_id, destination_type,%0A        context_id%0A      )%0A      SELECT%0A        oo.modified_by_id, NOW(), NOW(),%0A        oo.ownable_id, oo.ownable_type, oo.person_id, 'Person',%0A        oo.context_id%0A      FROM object_owners AS oo%0A      WHERE oo.ownable_type = 'Assessment'%0A  %22%22%22)%0A%0A  op.execute(%22%22%22%0A      INSERT INTO relationship_attrs (%0A        relationship_id, attr_name, attr_value%0A      )%0A      SELECT r.id, 'AssigneeType', 'Creator,Assessor'%0A      FROM relationships AS r%0A      WHERE r.source_type = 'Assessment';%0A  %22%22%22)%0A%0A  op.execute(%22%22%22UPDATE assessments SET status = 'Open'%22%22%22)%0A  op.execute(%22%22%22ALTER TABLE assessments%0A                CHANGE status status%0A                ENUM(%22Open%22,%22In Progress%22,%22Finished%22,%22Verified%22,%22Final%22)%0A                DEFAULT %22Open%22%0A                NOT NULL%0A  %22%22%22)%0A%0A%0Adef downgrade():%0A  pass%0A

Add migration for assignable mixin