{"action":"closed","issue":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/1908","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/1908/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/1908/comments","events_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/1908/events","html_url":"https://github.com/OrchardCMS/Orchard/issues/1908","id":68195439,"number":1908,"title":"Data migration mapping joins","user":{"login":"orchardbot","id":11788683,"avatar_url":"https://avatars.githubusercontent.com/u/11788683?v=3","gravatar_id":"","url":"https://api.github.com/users/orchardbot","html_url":"https://github.com/orchardbot","followers_url":"https://api.github.com/users/orchardbot/followers","following_url":"https://api.github.com/users/orchardbot/following{/other_user}","gists_url":"https://api.github.com/users/orchardbot/gists{/gist_id}","starred_url":"https://api.github.com/users/orchardbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchardbot/subscriptions","organizations_url":"https://api.github.com/users/orchardbot/orgs","repos_url":"https://api.github.com/users/orchardbot/repos","events_url":"https://api.github.com/users/orchardbot/events{/privacy}","received_events_url":"https://api.github.com/users/orchardbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OrchardCMS/Orchard/labels/medium","name":"medium","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"sebastienros","id":1165805,"avatar_url":"https://avatars.githubusercontent.com/u/1165805?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastienros","html_url":"https://github.com/sebastienros","followers_url":"https://api.github.com/users/sebastienros/followers","following_url":"https://api.github.com/users/sebastienros/following{/other_user}","gists_url":"https://api.github.com/users/sebastienros/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastienros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastienros/subscriptions","organizations_url":"https://api.github.com/users/sebastienros/orgs","repos_url":"https://api.github.com/users/sebastienros/repos","events_url":"https://api.github.com/users/sebastienros/events{/privacy}","received_events_url":"https://api.github.com/users/sebastienros/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/milestones/8","html_url":"https://github.com/OrchardCMS/Orchard/milestones/Orchard%201.3","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/milestones/8/labels","id":1065766,"number":8,"title":"Orchard 1.3","description":"Build: 1.3.10\nPublished: 10/3/2011, Updated 12/20/2011\n\n!! How to Install Orchard\n\nTo install Orchard using Web PI, follow these instructions: [url:http://www.orchardproject.net/docs/Installing-Orchard.ashx]. Web PI will detect your hardware environment and install the application.\n\nAlternatively, to install the release manually, download the Orchard.Web.1.3.10.zip file.\n\n[url:http://orchardproject.net/docs/Manually-installing-Orchard-zip-file.ashx]\n\nThe zip contents are pre-built and ready-to-run. Simply extract the contents of the Orchard\nfolder from the zip contents to an IIS virtual directory (or site root) and then point your\nbrowser to the site. You can also just extract to a local folder and open the Orchard\nfolder in Visual Studio or WebMatrix as a web site.\nPlease make sure you have a machine key [url:http://orchardproject.net/docs/Setting-up-a-machine-key.ashx]\nor you may experience frequent disconnections.\n\n!! How to Reset Your Site Data\n\nThe App_Data directory contains database and settings documents produced during setup.  \nThe contents of this directory are protected from download by visitors to your site. \n\n*To completely reset your site* (destroy all data, starting from the setup screen again), \nyou can delete the contents of this directory.  This action is irreversible!\n\n!! How to upgrade from a previous version\n\nYou can find migration instructions here: [url:http://orchardproject.net/docs/Upgrading-a-site-to-a-new-version-of-Orchard.ashx].\n\n!! What's new?\n\nOrchard 1.3.10 fixes bugs, improves performance and introduces the following features:\n\n* Content item preview\n* Markdown support\n* Delete content types and parts\n* Title part enables non-routable types to have a title\n* Common added by default to content types\n* Rules: trigger custom actions triggered by events\n* Forms API: create forms from code\n* Tokens: system-wide variables\n* New content manager methods: part eager loading, get multiple items by ids in one query\n* Task Lease API: creates server affinities for background tasks on web farms and cloud platforms\n* Localization: data annotations, widgets, alternates\n* Lists have RSS feeds\n\nThe full list of fixed bugs for this release can be found here: [url:Bugs fixed in 1.3|http://orchard.codeplex.com/workitem/list/advanced?keyword=&status=Closed&type=All&priority=All&release=Orchard%201.3&assignedTo=All&component=All&sortField=Votes&sortDirection=Descending&page=0]\n\n!! What file to download?\n\nIf you just want to use Orchard and don't care about the source code, Orchard.Web.1.3.10.zip\nis what you want to use, preferably through the WebPI instructions.\n\nIf you want to take a look at the source code, OrchardSource.1.3.10.zip is fine.\n\nIf you want to setup a development environment for patch or module development,\nyou should clone the repository by following the instructions here:\n[url:http://orchardproject.net/docs/Setting-up-a-source-enlistment.ashx]\n\nDo not attempt to build the WebPI version in VS. Use the full source if you want to use VS.\n\nBranches are described here: [url:http://orchardproject.net/docs/Developer-FAQ.ashx#What_are_the_default_and_dev_branches_Which_one_should_I_be_using_2]\n\n!! Who should use this software?\n\nThis software is in version 1.3.10. The code is in a stable state and constitutes a solid foundation for building applications, themes and modules. Suggestions are welcome in the discussion forums.\n\nYou are allowed to use this software in any way that is compatible with the new BSD license.\n\n!! Compatibility with ASP.NET WebPages and ASP.NET MVC\n\nThe 1.3.10 release of Orchard is only compatible with ASP.NET MVC 3. If you have installed WebMatrix Betas or RCs, you need to uninstall them from the machine where you run Orchard.\n\nNote: if you don't have ASP.NET MVC or WebMatrix installed, you are fine and you don't need to install them first as Orchard will then use its own copy.\n\nFor other known issues, please refer to [url:http://orchard.codeplex.com/workitem/list/basic].","creator":{"login":"orchardbot","id":11788683,"avatar_url":"https://avatars.githubusercontent.com/u/11788683?v=3","gravatar_id":"","url":"https://api.github.com/users/orchardbot","html_url":"https://github.com/orchardbot","followers_url":"https://api.github.com/users/orchardbot/followers","following_url":"https://api.github.com/users/orchardbot/following{/other_user}","gists_url":"https://api.github.com/users/orchardbot/gists{/gist_id}","starred_url":"https://api.github.com/users/orchardbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchardbot/subscriptions","organizations_url":"https://api.github.com/users/orchardbot/orgs","repos_url":"https://api.github.com/users/orchardbot/repos","events_url":"https://api.github.com/users/orchardbot/events{/privacy}","received_events_url":"https://api.github.com/users/orchardbot/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":24,"state":"closed","created_at":"2015-04-13T19:41:09Z","updated_at":"2015-04-13T21:12:46Z","due_on":"2011-10-03T07:00:00Z","closed_at":"2015-04-13T19:41:09Z"},"comments":2,"created_at":"2011-08-11T18:35:18Z","updated_at":"2015-04-13T21:12:46Z","closed_at":"2015-04-13T21:12:46Z","body":"@sebastienros created:\r\nhttps://orchard.codeplex.com/workitem/18081\r\n\r\nFinally got around to looking into a solution for now.\r\n\r\nNot ideal as it requires adding files to Orchard.Framework but it works.\r\n\r\nAdd the following classes:\r\n\r\n \r\n\r\n\r\nnamespace Orchard.Data.Conventions\r\n{\r\n    public class JoinAttribute : Attribute\r\n    {\r\n    }\r\n\r\n    public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance\r\n    {\r\n        public void Apply(IManyToOneInstance instance)\r\n        {\r\n            instance.Fetch.Join();\r\n        }\r\n\r\n        public void Accept(IAcceptanceCriteria<IManyToOneInspector> criteria)\r\n        {\r\n            criteria.Expect(x => x.Property != null && x.Property.IsDefined(typeof(JoinAttribute), false));\r\n        }\r\n    }\r\n}\r\n\r\n\r\nAdd the join attribute to ContentTagRecord\r\n\r\n \r\n\r\n \r\n\r\n\r\nnamespace Orchard.Tags.Models\r\n{\r\n    public class ContentTagRecord\r\n    {\r\n        public virtual int Id { get; set; }\r\n        [Join]\r\n        public virtual TagRecord TagRecord { get; set; }\r\n        public virtual TagsPartRecord TagsPartRecord { get; set; }\r\n    }\r\n}\r\n\r\n\r\n \r\n\r\nNew sql output with join\r\n\r\n \r\n\r\n\r\nSELECT tags0_.TagsPartRecord_Id as TagsPart3_2_,\r\n       tags0_.Id                as Id2_,\r\n       tags0_.Id                as Id43_1_,\r\n       tags0_.TagRecord_id      as TagRecord2_43_1_,\r\n       tags0_.TagsPartRecord_id as TagsPart3_43_1_,\r\n       tagrecord1_.Id           as Id44_0_,\r\n       tagrecord1_.TagName      as TagName44_0_\r\nFROM   Orchard_Tags_ContentTagRecord tags0_\r\n       left outer join Orchard_Tags_TagRecord tagrecord1_\r\n         on tags0_.TagRecord_id = tagrecord1_.Id\r\nWHERE  tags0_.TagsPartRecord_Id = 15 /* @p0 */"}}