strapi/docs/.vuepress/dist/assets/js/57.a87c48df.js
2018-10-05 17:24:17 +02:00

1 line
15 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{182:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("This migration guide is a mix of migrations from 3.0.0-alpha.11.1 to 3.0.0-alpha.11.2, 3.0.0-alpha.11.2 to 3.0.0-alpha.11.3 and from 3.0.0-alpha.11.3 to 3.0.0-alpha.12.1.3.")]),t._v(" "),a("blockquote",[a("p",[t._v("Feel free to "),a("a",{attrs:{href:"http://slack.strapi.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("join us on Slack"),a("OutboundLink")],1),t._v(" and ask questions about the migration process.")])]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._m(8),t._v(" "),a("p",[t._v("Delete your old admin folder and replace it by the new one.")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),a("p",[t._v("Create Authenticated role:")]),t._v(" "),t._m(16),t._m(17),t._v(" "),a("p",[t._v("You also will have to reset your roles permissions.")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._m(22)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"migrating-from-3-0-0-alpha-11-to-3-0-0-alpha-12-1-3"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#migrating-from-3-0-0-alpha-11-to-3-0-0-alpha-12-1-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Migrating from 3.0.0-alpha.11 to 3.0.0-alpha.12.1.3")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"getting-started"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-started","aria-hidden":"true"}},[this._v("#")]),this._v(" Getting started")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Install Strapi "),s("code",[this._v("alpha.12.1.3")]),this._v(" globally on your computer. To do so run "),s("code",[this._v("npm install strapi@3.0.0-alpha.12.1.3 -g")]),this._v(".")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("When it's done, generate a new empty project "),s("code",[this._v("strapi new myNewProject")]),this._v(" (don't pay attention to the database configuration).")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"configurations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configurations","aria-hidden":"true"}},[this._v("#")]),this._v(" Configurations")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("You will have to update just 1 file: "),s("code",[this._v("package.json")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Edit the Strapi's dependencies version: (move Strapi's dependencies to "),s("code",[this._v("3.0.0-alpha.12.1.3")]),this._v(" version) in "),s("code",[this._v("package.json")]),this._v(" file")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"dependencies"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"lodash"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"4.x.x"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"strapi"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"3.0.0-alpha.12.1.3"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"strapi-mongoose"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"3.0.0-alpha.12"')]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"update-the-admin"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#update-the-admin","aria-hidden":"true"}},[this._v("#")]),this._v(" Update the Admin")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"update-the-plugins"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#update-the-plugins","aria-hidden":"true"}},[this._v("#")]),this._v(" Update the Plugins")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Copy the fields and relations you had in your "),s("code",[this._v("/plugins/users-permissions/models/User.settings.json")]),this._v(" file in the new one.")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Then, delete your old "),s("code",[this._v("plugins")]),this._v(" folder and replace it by the new one.")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"update-roles"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#update-roles","aria-hidden":"true"}},[this._v("#")]),this._v(" Update roles")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("This update is if you come from version before alpha-11.2")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Update "),s("code",[this._v("type")]),this._v(" of "),s("code",[this._v("Guest")]),this._v(" role to "),s("code",[this._v("public")]),this._v(" in your database. You can also update name and description:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"name"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"Public"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"description"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"Default role given to unauthenticated user."')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"type"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"public"')]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"name"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"Authenticated"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"description"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"Default role given to authenticated user."')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token property"}},[t._v('"type"')]),a("span",{attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"authenticated"')]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("In "),s("code",[this._v("Users & Permissions > Advanced")]),this._v(" in admin panel update default role to "),s("code",[this._v("Authenticated")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"update-bookshelf-filters"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#update-bookshelf-filters","aria-hidden":"true"}},[this._v("#")]),this._v(" Update bookshelf filters")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"warning custom-block"},[s("p",{staticClass:"custom-block-title"},[this._v("WARNING")]),this._v(" "),s("p",[this._v("This update is if you come from version before alpha-11.3")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("You will have to replace your "),s("code",[this._v("fetchAll")]),this._v(" services queries of your generated API:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("_"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("forEach")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("where"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("where"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" key"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("isArray")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("const")]),t._v(" value "),a("span",{attrs:{class:"token keyword"}},[t._v("in")]),t._v(" where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n qb"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value "),a("span",{attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'where'")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'orWhere'")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value"),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n qb"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("where")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" where"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sort"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n qb"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("orderBy")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sort"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("key"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sort"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("order"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n qb"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("offset")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n qb"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("limit")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("convertedParams"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("limit"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("That's all, you have now upgraded to Strapi "),s("code",[this._v("alpha.12.1.3")]),this._v(".")])}],!1,null,null,null);e.options.__file="migration-guide-alpha-11-to-alpha-12.md";s.default=e.exports}}]);