Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contains a migration to remove the resourcegroups and have the resource have a reference direct to it's package, this removes a lot of joins. Drop constraint on resource_group_revision that travis complains about (but local install does not)
- Loading branch information
Showing
21 changed files
with
128 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import ckan.model | ||
|
||
|
||
def upgrade(migrate_engine): | ||
migrate_engine.execute( | ||
''' | ||
ALTER TABLE "resource" ADD COLUMN "package_id" text NOT NULL DEFAULT ''; | ||
UPDATE "resource" AS R | ||
SET package_id = G.package_id | ||
FROM "resource_group" AS G | ||
WHERE R.resource_group_id = G.id; | ||
ALTER TABLE "resource" DROP COLUMN "resource_group_id"; | ||
ALTER TABLE "resource_revision" ADD COLUMN "package_id" text NOT NULL DEFAULT ''; | ||
UPDATE "resource_revision" AS R | ||
SET package_id = G.package_id | ||
FROM "resource_group_revision" AS G | ||
WHERE R.resource_group_id = G.id; | ||
ALTER TABLE "resource_revision" DROP COLUMN "resource_group_id"; | ||
ALTER TABLE resource_group_revision DROP CONSTRAINT resource_group_revision_continuity_id_fkey; | ||
DROP TABLE "resource_group_revision"; | ||
DROP TABLE "resource_group"; | ||
''' | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.