Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove statefulness from package extras
* This is part of getting rid of vdm. * We don't need to store state in PackageExtra any more because you can view the history via activity stream, since it now stores the full package_dict #3972. (The package_extra_revision table will be used to migrate old versions of the package to activity_streams migrate_package_activity.py. But from this version of CKAN, we do not need to record PackageExtra.stateit any more.) * The mapping between PackageExtra and Package is now a simply dict i.e. attribute_mapped_collection - not a vdm StatefulDict any more. * vdm's OurAssociationProxy is replaced by the vanilla sqlalchemy association_proxy - I'm not clear why we had to prevent scalars being assigned in the first place since it is a dict mapping, not a scalar mapping. Seems ok. * package_extras_save() now deletes PackageExtra objects, instead of changing state to 'deleted'. * package_no_state/extras_list is no longer needed because it was only used by package_extras_save() * migration deletes extras of state='deleted', otherwise they'd suddenly appear
- Loading branch information
David Read
committed
Mar 15, 2019
1 parent
bf985bf
commit 7257e0a
Showing
5 changed files
with
25 additions
and
68 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
9 changes: 9 additions & 0 deletions
9
ckan/migration/versions/088_delete_extras_which_are_deleted_state.py
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,9 @@ | ||
# encoding: utf-8 | ||
|
||
|
||
def upgrade(migrate_engine): | ||
migrate_engine.execute( | ||
''' | ||
DELETE FROM "package_extra" WHERE 'state'='deleted'; | ||
''' | ||
) |
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